Search

activate_plugins( string|array $plugins, string $redirect = '', bool $network_wide = false, bool $silent = false )

Activate multiple plugins.

Description Description

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.


Parameters Parameters

$plugins

(string|array) (Required) Single plugin or list of plugins to activate.

$redirect

(string) (Optional) Redirect to page after successful activation.

Default value: ''

$network_wide

(bool) (Optional) Whether to enable the plugin for all sites in the network.

Default value: false

$silent

(bool) (Optional) Prevent calling activation hooks. Default is false.

Default value: false


Top ↑

Return Return

(bool|WP_Error) True when finished or WP_Error if there were errors during a plugin activation.


The files of WordPress characterize many helpful PHP functions. A portion of the functions, known as Template Tags, are characterized particularly for use in WordPress Themes. There are likewise a few functions identified with actions and filters (the Plugin API), which are in this way utilized principally for creating Plugins. The rest are utilized to make the core WordPress functionality. Huge numbers of the core WordPress functions are helpful to Plugin and Theme developers.