Inline documentation for hooks in wp-admin/includes/plugin.php

See #25229 props dllh

Built from https://develop.svn.wordpress.org/trunk@25474


git-svn-id: http://core.svn.wordpress.org/trunk@25395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Westwood 2013-09-18 07:38:12 +00:00
parent ef9b9664e1
commit 8f621ffc78
1 changed files with 69 additions and 0 deletions

View File

@ -540,7 +540,26 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
include_once(WP_PLUGIN_DIR . '/' . $plugin);
if ( ! $silent ) {
/**
* Fires before a plugin is activated in activate_plugin() when the $silent parameter is false
*
* @since 3.0.2
*
* @param string $plugin Basename of the plugin path from {@see activate_plugin()}
* @param bool $network_wide Argument from {@see activate_plugin()}
*/
do_action( 'activate_plugin', $plugin, $network_wide );
/**
* Fires before a plugin is activated in activate_plugin() when the $silent parameter is false
*
* The action concatenates the 'activate_' prefix with the $plugin value passed to
* activate_plugin() to create a dynamically named action.
*
* @since 3.0.2
*
* @param bool $network_wide Argument from {@see activate_plugin()}
*/
do_action( 'activate_' . $plugin, $network_wide );
}
@ -554,6 +573,14 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
}
if ( ! $silent ) {
/**
* Fires after a plugin has been activated in activate_plugin() when the $silent parameter is false
*
* @since 3.0.2
*
* @param string $plugin Basename of the plugin path from {@see activate_plugin()}
* @param bool $network_wide Argument from {@see activate_plugin()}
*/
do_action( 'activated_plugin', $plugin, $network_wide );
}
@ -594,6 +621,16 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
$network_deactivating = false !== $network_wide && is_plugin_active_for_network( $plugin );
if ( ! $silent )
/**
* Fires for each plugin being deactivated in deactivate_plugins(), before deactivation
* and when the $silent parameter is false.
*
* @since 3.3.2
*
* @param string $plugin Basename of the plugin path from {@see activate_plugin()}
* @param bool $network_deactivating True if $network_wide passed in {@see deactivate_plugin()}
* is true and the plugin is active for the network.
*/
do_action( 'deactivate_plugin', $plugin, $network_deactivating );
if ( false !== $network_wide ) {
@ -614,7 +651,30 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
}
if ( ! $silent ) {
/**
* Fires for each plugin being deactivated in deactivate_plugins(), after deactivation
* and when the $silent parameter is false.
*
* The action concatenates the 'deactivate_' prefix with the plugin's basename
* to create a dynamically named action.
*
* @since 3.3.2
*
* @param bool $network_deactivating True if $network_wide passed in {@see deactivate_plugin()}
* is true and the plugin is active for the network.
*/
do_action( 'deactivate_' . $plugin, $network_deactivating );
/**
* Fires for each plugin being deactivated in deactivate_plugins(), after deactivation
* and when the $silent parameter is false.
*
* @since 3.3.2
*
* @param string $plugin Basename of the plugin path from {@see activate_plugin()}
* @param bool $network_deactivating True if $network_wide passed in {@see deactivate_plugin()}
* is true and the plugin is active for the network.
*/
do_action( 'deactivated_plugin', $plugin, $network_deactivating );
}
}
@ -865,6 +925,15 @@ function uninstall_plugin($plugin) {
include WP_PLUGIN_DIR . '/' . $file;
add_action( 'uninstall_' . $file, $callable );
/**
* Fires in uninstall_plugin() once the plugin has been uninstalled.
*
* The action concatenates the 'uninstall_' prefix with the basename of the
* plugin passed to {@see uninstall_plugin()} to create a dynamically named action.
*
* @since 2.6.1
*/
do_action( 'uninstall_' . $file );
}
}