Allow plugins to activate other plugins within their Activation hook. Fixes #32368

git-svn-id: https://develop.svn.wordpress.org/trunk@32504 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2015-05-14 06:57:47 +00:00
parent 11671ad73b
commit 047c2fdadd
1 changed files with 2 additions and 0 deletions

View File

@ -576,9 +576,11 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
}
if ( $network_wide ) {
$current = get_site_option( 'active_sitewide_plugins', array() );
$current[$plugin] = time();
update_site_option( 'active_sitewide_plugins', $current );
} else {
$current = get_option( 'active_plugins', array() );
$current[] = $plugin;
sort($current);
update_option('active_plugins', $current);