activate_plugin Wordpress function


Attempts activation of plugin in a "sandbox" and redirects on success.



(string) $plugin Plugin path to main plugin file with plugin data.
(string) $redirect Optional. URL to redirect to.
(bool) $network_wide Whether to enable the plugin for all sites in the network or just the current site. Multisite only. Default is false.
(bool) $silent Prevent calling activation hooks. Optional, default is false.

Return Type:

(WP_Error|null) WP_Error on invalid file or null on success.

Define At:


Wordpress Reference URL:

0 Flares Facebook 0 Google+ 0 0 Flares ×
Posted in: Wordpress functions
0 Flares Facebook 0 Pin It Share 0 Google+ 0 0 Flares ×