-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated to v2.3.6 to fix API error when installing a single plugin fr…
…om an externally hosted source
- Loading branch information
1 parent
67ef217
commit 39e49f0
Showing
3 changed files
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* Plugin installation and activation for WordPress themes. | ||
* | ||
* @package TGM-Plugin-Activation | ||
* @version 2.3.5 | ||
* @version 2.3.6 | ||
* @author Thomas Griffin <[email protected]> | ||
* @author Gary Jones <[email protected]> | ||
* @copyright Copyright (c) 2012, Thomas Griffin | ||
|
@@ -445,14 +445,16 @@ protected function do_plugin_install() { | |
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for plugins_api | ||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Need for upgrade classes | ||
|
||
$api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) ); | ||
|
||
if ( is_wp_error( $api ) ) | ||
wp_die( $this->strings['oops'] . var_dump( $api ) ); | ||
|
||
/** Set plugin source to WordPress API link if available */ | ||
if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] && isset( $api->download_link ) ) | ||
$plugin['source'] = $api->download_link; | ||
if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] ) { | ||
$api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) ); | ||
|
||
if ( is_wp_error( $api ) ) | ||
wp_die( $this->strings['oops'] . var_dump( $api ) ); | ||
|
||
if ( isset( $api->download_link ) ) | ||
$plugin['source'] = $api->download_link; | ||
} | ||
|
||
/** Set type, based on whether the source starts with http:// or https:// */ | ||
$type = preg_match( '|^http(s)?://|', $plugin['source'] ) ? 'web' : 'upload'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* | ||
* @package TGM-Plugin-Activation | ||
* @subpackage Example | ||
* @version 2.3.5 | ||
* @version 2.3.6 | ||
* @author Thomas Griffin <[email protected]> | ||
* @author Gary Jones <[email protected]> | ||
* @copyright Copyright (c) 2012, Thomas Griffin | ||
|