activate_plugins
activate_plugins ( $plugins, $redirect = '', $network_wide = false, $silent = false )
Parameters:- (string|string[]) 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. Default false.
- (bool) silent Prevent calling activation hooks. Default false.
Returns:- (true|WP_Error) True when finished or WP_Error if there were errors during a plugin activation.
Defined at: - Introduced in WordPress: 2.6.0
- Deprecated in WordPress: —
Description
Activates 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 plugin file paths were invalid.
The execution will be halted as soon as one of the plugins has an error.