activate_plugin action-hook . WP 2.9.0
Fires before a plugin is activated.
If a plugin is silently activated (such as during an update), this hook does not fire.
Usage
add_action( 'activate_plugin', 'action_function_name_8973', 10, 2 ); function action_function_name_8973( $plugin, $network_wide ){ // action... }
- $plugin(string)
- Path to the plugin file relative to the plugins directory.
- $network_wide(true/false)
- Whether to enable the plugin 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 686
do_action( 'activate_plugin', $plugin, $network_wide );