deactivate_plugin
Fires before a plugin is deactivated.
If a plugin is silently deactivated (such as during an update), this hook does not fire.
Usage
add_action( 'deactivate_plugin', 'wp_kama_deactivate_plugin_action', 10, 2 );
/**
* Function for `deactivate_plugin` action-hook.
*
* @param string $plugin Path to the plugin file relative to the plugins directory.
* @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network or just the current site. Multisite only.
*
* @return void
*/
function wp_kama_deactivate_plugin_action( $plugin, $network_deactivating ){
// action...
}
- $plugin(string)
- Path to the plugin file relative to the plugins directory.
- $network_deactivating(true|false)
- Whether the plugin is deactivated for all sites in the network or just the current site. Multisite only.
Default: false
Changelog
| Since 2.9.0 | Introduced. |
Where the hook is called
wp-admin/includes/plugin.php 787
do_action( 'deactivate_plugin', $plugin, $network_deactivating );