mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Fix bulk activation of network-only plugins. Fixes #26487. Props dd32.
Built from https://develop.svn.wordpress.org/trunk@27413 git-svn-id: http://core.svn.wordpress.org/trunk@27260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
79d274f2f6
commit
4676621110
@ -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 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user