From 37f29e649ee7cf41bd461380423e6f33f5895086 Mon Sep 17 00:00:00 2001 From: scribu Date: Sat, 13 Nov 2010 16:25:56 +0000 Subject: [PATCH] Move network only status check out of foreach. See #15318 git-svn-id: http://svn.automattic.com/wordpress/trunk@16346 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-plugins-list-table.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index ff9505ad0e..8baeba94ac 100644 --- a/wp-admin/includes/class-wp-plugins-list-table.php +++ b/wp-admin/includes/class-wp-plugins-list-table.php @@ -191,7 +191,7 @@ class WP_Plugins_List_Table extends WP_List_Table { function get_sortable_columns() { return array( - 'name' => 'name', + 'name' => 'name', ); } @@ -308,6 +308,9 @@ class WP_Plugins_List_Table extends WP_List_Table { $screen = get_current_screen(); + if ( is_multisite() && !$screen->is_network && in_array( $context, array( 'mustuse', 'dropins' ) ) ) + return; + foreach ( $this->items as $plugin_file => $plugin_data ) { // preorder $actions = array( @@ -319,12 +322,8 @@ class WP_Plugins_List_Table extends WP_List_Table { ); if ( 'mustuse' == $context ) { - if ( is_multisite() && !$screen->is_network ) - continue; $is_active = true; } elseif ( 'dropins' == $context ) { - if ( is_multisite() && !$screen->is_network ) - continue; $dropins = _get_dropins(); $plugin_name = $plugin_file; if ( $plugin_file != $plugin_data['Name'] )