Make WordPress Core

Changeset 27413


Ignore:
Timestamp:
03/05/2014 06:25:20 PM (10 years ago)
Author:
johnbillion
Message:

Fix bulk activation of network-only plugins. Fixes #26487. Props dd32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugins.php

    r27280 r27413  
    7070            $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
    7171
    72             // Only activate plugins which are not already active.
    7372            if ( is_network_admin() ) {
    7473                foreach ( $plugins as $i => $plugin ) {
    75                     if ( is_plugin_active_for_network( $plugin ) )
     74                    // Only activate plugins which are not already network activated.
     75                    if ( is_plugin_active_for_network( $plugin ) ) {
    7676                        unset( $plugins[ $i ] );
     77                    }
    7778                }
    7879            } else {
    7980                foreach ( $plugins as $i => $plugin ) {
    80                     if ( is_plugin_active( $plugin ) || is_network_only_plugin( $plugin ) )
     81                    // Only activate plugins which are not already active and are not network-only when on Multisite.
     82                    if ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) {
    8183                        unset( $plugins[ $i ] );
     84                    }
    8285                }
    8386            }
Note: See TracChangeset for help on using the changeset viewer.