diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index a05f0deb10..a862c5106c 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -122,12 +122,10 @@ function deactivate_plugins($plugins, $silent= false) { $plugins = array($plugins); foreach ( $plugins as $plugin ) { - $item = array_search( $plugin, $current); - if( false === $item) + if( ! is_plugin_active($plugin) ) continue; - if ( ( $key = array_search( $plugin, $current) ) !== false ) - array_splice($current, $key, 1 ); // Fixed Array-fu! - if ( ! $silent ) + array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu! + if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. do_action('deactivate_' . trim( $plugin )); }