Make WordPress Core

Ticket #14170: deactivate_plugins.diff

File deactivate_plugins.diff, 1.2 KB (added by scribu, 14 years ago)
  • wp-admin/includes/plugin.php

     
    512512 * @since unknown
    513513 *
    514514 * @param string|array $plugins Single plugin or list of plugins to deactivate.
    515  * @param bool $silent Optional, default is false. Prevent calling deactivate hook.
     515 * @param bool $silent Optional, default is false. Prevent calling deactivate hook.
     516 *  Used by the updater to internally deactivate plugins, but not notifying them
     517 *  of the fact, to prevent unexpected output.
    516518 */
    517519function deactivate_plugins( $plugins, $silent = false ) {
    518520        $network_current = get_site_option( 'active_sitewide_plugins', array() );
     
    539541                        }
    540542                }
    541543
    542                 //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
    543                 if ( ! $silent ) {
     544                // Don't trigger if the plugin will still be active on the current blog
     545                if ( !$silent && !( $do_network && in_array( $plugin, $current ) ) ) {
    544546                        do_action( 'deactivate_' . trim( $plugin ) );
    545547                        do_action( 'deactivated_plugin', trim( $plugin ) );
    546548                }