When a plugin enables Background Plugin updates, don't deactivate the plugin during update as we require a browser to reactivate it afterwards. See #22704

git-svn-id: https://develop.svn.wordpress.org/trunk@25817 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-10-16 19:47:21 +00:00
parent 4bcad55280
commit 853c9a50bd
1 changed files with 4 additions and 0 deletions

View File

@ -662,6 +662,10 @@ class Plugin_Upgrader extends WP_Upgrader {
if ( is_wp_error($return) ) //Bypass.
return $return;
// When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it
if ( defined( 'DOING_CRON' ) && DOING_CRON )
return $return;
$plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
if ( empty($plugin) )
return new WP_Error('bad_request', $this->strings['bad_request']);