mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
In activate_plugin()
, do not re-run the activation routine for already-active network-wide plugins.
Adds unit test. Props jbrinley. Fixes #28651. Built from https://develop.svn.wordpress.org/trunk@29818 git-svn-id: http://core.svn.wordpress.org/trunk@29584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
71bca51151
commit
59ef20d458
@ -533,7 +533,7 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen
|
||||
if ( is_wp_error($valid) )
|
||||
return $valid;
|
||||
|
||||
if ( !in_array($plugin, $current) ) {
|
||||
if ( ( $network_wide && ! isset( $current[ $plugin ] ) ) || ( ! $network_wide && ! in_array( $plugin, $current ) ) ) {
|
||||
if ( !empty($redirect) )
|
||||
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
|
||||
ob_start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user