Make WordPress Core


Ignore:
Timestamp:
02/28/2014 08:21:52 PM (10 years ago)
Author:
johnbillion
Message:

Don't filter out network-only plugins from the Plugins screen if they're individually active on the current site. Add some code comments for clarity. Props mordauk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r25425 r27326  
    8484        foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
    8585            // Filter into individual sections
    86             if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) ) {
     86            if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) {
     87                // On the non-network screen, filter out network-only plugins as long as they're not individually activated
    8788                unset( $plugins['all'][ $plugin_file ] );
    8889            } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {
     90                // On the non-network screen, filter out network activated plugins
    8991                unset( $plugins['all'][ $plugin_file ] );
    9092            } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
    9193                || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {
     94                // On the non-network screen, populate the active list with plugins that are individually activated
     95                // On the network-admin screen, populate the active list with plugins that are network activated
    9296                $plugins['active'][ $plugin_file ] = $plugin_data;
    9397            } else {
    94                 if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
     98                if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) {
     99                    // On the non-network screen, populate the recently activated list with plugins that have been recently activated
    95100                    $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
     101                }
     102                // Populate the inactive list with plugins that aren't activated
    96103                $plugins['inactive'][ $plugin_file ] = $plugin_data;
    97104            }
Note: See TracChangeset for help on using the changeset viewer.