From 153f807893aa94f96286316cebf83b35fa7c7a8e Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Wed, 5 Mar 2014 18:25:20 +0000 Subject: [PATCH] Fix bulk activation of network-only plugins. Fixes #26487. Props dd32. git-svn-id: https://develop.svn.wordpress.org/trunk@27413 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/plugins.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php index 261f0f24fd..32b77ed829 100644 --- a/src/wp-admin/plugins.php +++ b/src/wp-admin/plugins.php @@ -69,16 +69,19 @@ if ( $action ) { $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); - // Only activate plugins which are not already active. if ( is_network_admin() ) { foreach ( $plugins as $i => $plugin ) { - if ( is_plugin_active_for_network( $plugin ) ) + // Only activate plugins which are not already network activated. + if ( is_plugin_active_for_network( $plugin ) ) { unset( $plugins[ $i ] ); + } } } else { foreach ( $plugins as $i => $plugin ) { - if ( is_plugin_active( $plugin ) || is_network_only_plugin( $plugin ) ) + // Only activate plugins which are not already active and are not network-only when on Multisite. + if ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) { unset( $plugins[ $i ] ); + } } }