Docs: Improve documentation for deactivate_plugins() and activate_plugins().

Props marekdedic, spenserhale, SergeyBiryukov.
Fixes #48352.

git-svn-id: https://develop.svn.wordpress.org/trunk@46694 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-11-10 23:03:34 +00:00
parent 1b82ea8284
commit 84540ab336

View File

@ -726,10 +726,11 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
*
* @since 2.5.0
*
* @param string|array $plugins Single plugin or list of plugins to deactivate.
* @param bool $silent Prevent calling deactivation hooks. Default is false.
* @param mixed $network_wide Whether to deactivate the plugin for all sites in the network.
* A value of null (the default) will deactivate plugins for both the site and the network.
* @param string|string[] $plugins Single plugin or list of plugins to deactivate.
* @param bool $silent Prevent calling deactivation hooks. Default false.
* @param bool|null $network_wide Whether to deactivate the plugin for all sites in the network.
* A value of null will deactivate plugins for both the network
* and the current site. Multisite only. Default null.
*/
function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
if ( is_multisite() ) {
@ -758,7 +759,7 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
*
* @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. Default is false.
* or just the current site. Multisite only. Default false.
*/
do_action( 'deactivate_plugin', $plugin, $network_deactivating );
}
@ -797,7 +798,7 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
* @since 2.0.0
*
* @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network
* or just the current site. Multisite only. Default is false.
* or just the current site. Multisite only. Default false.
*/
do_action( "deactivate_{$plugin}", $network_deactivating );
@ -810,7 +811,7 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
* @since 2.9.0
*
* @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.
* @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network
* or just the current site. Multisite only. Default false.
*/
do_action( 'deactivated_plugin', $plugin, $network_deactivating );
@ -829,16 +830,17 @@ function deactivate_plugins( $plugins, $silent = false, $network_wide = null ) {
* Activate multiple plugins.
*
* When WP_Error is returned, it does not mean that one of the plugins had
* errors. It means that one or more of the plugins file path was invalid.
* errors. It means that one or more of the plugin file paths were invalid.
*
* The execution will be halted as soon as one of the plugins has an error.
*
* @since 2.6.0
*
* @param string|array $plugins Single plugin or list of plugins to activate.
* @param string $redirect Redirect to page after successful activation.
* @param bool $network_wide Whether to enable the plugin for all sites in the network.
* @param bool $silent Prevent calling activation hooks. Default is false.
* @param string|string[] $plugins Single plugin or list of plugins to activate.
* @param string $redirect Redirect to page after successful activation.
* @param bool $network_wide Whether to enable the plugin for all sites in the network.
* Default false.
* @param bool $silent Prevent calling activation hooks. Default false.
* @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
*/
function activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) {