Make WordPress Core

Ticket #27188: plugin.php.move-deactivated_plugin.patch

File plugin.php.move-deactivated_plugin.patch, 1.6 KB (added by wpsmith, 9 years ago)

Option 1 (preferable): move action

  • wp-admin/includes/plugin.php

     
    670670                         */
    671671                        do_action( 'deactivate_' . $plugin, $network_deactivating );
    672672
    673                         /**
    674                          * Fires for each plugin being deactivated in deactivate_plugins(), after deactivation
    675                          * and when the $silent parameter is false.
    676                          *
    677                          * @since 2.9.0
    678                          *
    679                          * @param string $plugin               Plugin path to main plugin file with plugin data.
    680                          * @param bool   $network_deactivating Whether the plugin is deactivated for all sites in the network
    681                          *                                     or just the current site. Multisite only. Default is false.
    682                          */
    683                         do_action( 'deactivated_plugin', $plugin, $network_deactivating );
    684673                }
    685674        }
    686675
     
    688677                update_option('active_plugins', $current);
    689678        if ( $do_network )
    690679                update_site_option( 'active_sitewide_plugins', $network_current );
     680       
     681        if ( ! $silent ) {
     682                /**
     683                 * Fires for each plugin being deactivated in deactivate_plugins(), after deactivation
     684                 * and when the $silent parameter is false.
     685                 *
     686                 * @since 2.9.0
     687                 *
     688                 * @param string $plugin               Plugin path to main plugin file with plugin data.
     689                 * @param bool   $network_deactivating Whether the plugin is deactivated for all sites in the network
     690                 *                                     or just the current site. Multisite only. Default is false.
     691                 */
     692                do_action( 'deactivated_plugin', $plugin, $network_deactivating );
     693        }
    691694}
    692695
    693696/**