activate_plugins


activate_plugins ( $plugins, $redirect = '', $network_wide = false, $silent = false )

Parameters:
  • (string|array) $plugins Single plugin or list of plugins to activate.
  • (string) $redirect Redirect to page after successful activation.
  • (bool) $network_wide Whether to enable the plugin for all sites in the network.
  • (bool) $silent Prevent calling activation hooks. Default is false.
Returns:
  • (bool|WP_Error) True when finished or WP_Error if there were errors during a plugin activation.
Defined at:

Description

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.

The execution will be halted as soon as one of the plugins has an error.

Related Functions

activate_plugin, deactivate_plugins, activate_sitewide_plugin, validate_active_plugins, deactivate_sitewide_plugin

Top Google Results

User discussions

wpseek mobile