mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
More add/delete/update actions. Props Demitrious Kelly. see #10750
git-svn-id: https://develop.svn.wordpress.org/trunk@11909 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -314,8 +314,10 @@ function activate_plugin($plugin, $redirect = '') {
|
||||
@include(WP_PLUGIN_DIR . '/' . $plugin);
|
||||
$current[] = $plugin;
|
||||
sort($current);
|
||||
do_action( 'activate_plugin', trim( $plugin) );
|
||||
update_option('active_plugins', $current);
|
||||
do_action('activate_' . $plugin);
|
||||
do_action( 'activate_' . trim( $plugin ) );
|
||||
do_action( 'activated_plugin', trim( $plugin) );
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
@@ -343,9 +345,14 @@ function deactivate_plugins($plugins, $silent= false) {
|
||||
$plugin = plugin_basename($plugin);
|
||||
if( ! is_plugin_active($plugin) )
|
||||
continue;
|
||||
if ( ! $silent )
|
||||
do_action( 'deactivate_plugin', trim( $plugin ) );
|
||||
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 ));
|
||||
//Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
|
||||
if ( ! $silent ) {
|
||||
do_action( 'deactivate_' . trim( $plugin ) );
|
||||
do_action( 'deactivated_plugin', trim( $plugin ) );
|
||||
}
|
||||
}
|
||||
|
||||
update_option('active_plugins', $current);
|
||||
|
||||
Reference in New Issue
Block a user