diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php
index 8baeba94ac..b86ead3565 100644
--- a/wp-admin/includes/class-wp-plugins-list-table.php
+++ b/wp-admin/includes/class-wp-plugins-list-table.php
@@ -302,137 +302,145 @@ class WP_Plugins_List_Table extends WP_List_Table {
}
function display_rows() {
+ global $status;
+
+ $screen = get_current_screen();
+
+ if ( is_multisite() && !$screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
+ return;
+
+ foreach ( $this->items as $plugin_file => $plugin_data )
+ $this->single_row( $plugin_file, $plugin_data );
+ }
+
+ function single_row( $plugin_file, $plugin_data ) {
global $status, $page, $s;
$context = $status;
$screen = get_current_screen();
- if ( is_multisite() && !$screen->is_network && in_array( $context, array( 'mustuse', 'dropins' ) ) )
- return;
+ // preorder
+ $actions = array(
+ 'network_deactivate' => '', 'deactivate' => '',
+ 'network_only' => '', 'activate' => '',
+ 'network_activate' => '',
+ 'edit' => '',
+ 'delete' => '',
+ );
- foreach ( $this->items as $plugin_file => $plugin_data ) {
- // preorder
- $actions = array(
- 'network_deactivate' => '', 'deactivate' => '',
- 'network_only' => '', 'activate' => '',
- 'network_activate' => '',
- 'edit' => '',
- 'delete' => '',
- );
-
- if ( 'mustuse' == $context ) {
+ if ( 'mustuse' == $context ) {
+ $is_active = true;
+ } elseif ( 'dropins' == $context ) {
+ $dropins = _get_dropins();
+ $plugin_name = $plugin_file;
+ if ( $plugin_file != $plugin_data['Name'] )
+ $plugin_name .= '
' . $plugin_data['Name'];
+ if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
$is_active = true;
- } elseif ( 'dropins' == $context ) {
- $dropins = _get_dropins();
- $plugin_name = $plugin_file;
- if ( $plugin_file != $plugin_data['Name'] )
- $plugin_name .= '
' . $plugin_data['Name'];
- if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
- $is_active = true;
- $description = '
' . $dropins[ $plugin_file ][0] . '
'; - } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true - $is_active = true; - $description = '' . $dropins[ $plugin_file ][0] . '
'; - } else { - $is_active = false; - $description = '' . $dropins[ $plugin_file ][0] . ' ' . __('Inactive:') . ' ' . sprintf( __( 'Requires %s
in wp-config.php
.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '
' . $plugin_data['Description'] . '
'; + $description = '' . $dropins[ $plugin_file ][0] . '
'; + } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true + $is_active = true; + $description = '' . $dropins[ $plugin_file ][0] . '
'; } else { - $is_active_for_network = is_plugin_active_for_network($plugin_file); - if ( $screen->is_network ) - $is_active = $is_active_for_network; - else - $is_active = is_plugin_active( $plugin_file ); - - if ( $is_active_for_network && !is_super_admin() && !$screen->is_network ) - continue; - - if ( $screen->is_network ) { - if ( $is_active_for_network ) { - if ( current_user_can( 'manage_network_plugins' ) ) - $actions['network_deactivate'] = '' . __('Network Deactivate') . ''; - } else { - if ( current_user_can( 'manage_network_plugins' ) ) - $actions['network_activate'] = '' . __('Network Activate') . ''; - if ( current_user_can('delete_plugins') ) - $actions['delete'] = '' . __('Delete') . ''; - } - } else { - if ( $is_active ) { - $actions['deactivate'] = '' . __('Deactivate') . ''; - } else { - if ( is_network_only_plugin( $plugin_file ) && !$screen->is_network ) - continue; - - $actions['activate'] = '' . __('Activate') . ''; - - if ( ! is_multisite() && current_user_can('delete_plugins') ) - $actions['delete'] = '' . __('Delete') . ''; - } // end if $is_active - } // end if $screen->is_network - - if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) - $actions['edit'] = '' . __('Edit') . ''; - } // end if $context - - $actions = apply_filters( 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context ); - $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context ); - - $class = $is_active ? 'active' : 'inactive'; - $checkbox_id = md5($plugin_data['Name']) . "_checkbox"; - $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : ""; - if ( 'dropins' != $status ) { - $description = '' . $plugin_data['Description'] . '
'; - $plugin_name = $plugin_data['Name']; + $is_active = false; + $description = '' . $dropins[ $plugin_file ][0] . ' ' . __('Inactive:') . ' ' . sprintf( __( 'Requires %s
in wp-config.php
.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '
' . $plugin_data['Description'] . '
'; + } else { + $is_active_for_network = is_plugin_active_for_network($plugin_file); + if ( $screen->is_network ) + $is_active = $is_active_for_network; + else + $is_active = is_plugin_active( $plugin_file ); - $id = sanitize_title( $plugin_name ); + if ( $is_active_for_network && !is_super_admin() && !$screen->is_network ) + return; - echo " -