mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
Use is_plugin_active() and remove double searching. Props DD32. fixes #6332
git-svn-id: http://svn.automattic.com/wordpress/trunk@7488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b274b643a1
commit
0590b75eec
@ -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 ));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user