Make WordPress Core

Ticket #15269: 15269.5.patch

File 15269.5.patch, 9.0 KB (added by ocean90, 14 years ago)
  • wp-admin/includes/class-wp-ms-themes-list-table.php

     
    9595                        uasort( $this->items, array( &$this, '_order_callback' ) );
    9696                }
    9797
    98                 $themes_per_page = $this->get_items_per_page( 'themes_per_page', 999 );
     98                $themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
    9999
    100100                $start = ( $page - 1 ) * $themes_per_page;
    101101
  • wp-admin/includes/misc.php

     
    343343
    344344                switch ( $map_option ) {
    345345                        case 'edit_per_page':
    346                         case 'sites_network_per_page':
    347346                        case 'users_per_page':
    348                         case 'users_network_per_page':
    349347                        case 'edit_comments_per_page':
    350348                        case 'upload_per_page':
    351349                        case 'edit_tags_per_page':
    352350                        case 'plugins_per_page':
     351                        // Network admin
     352                        case 'sites_network_per_page':
     353                        case 'users_network_per_page':
     354                        case 'plugins_network_per_page':
     355                        case 'themes_network_per_page':
    353356                                $value = (int) $value;
    354357                                if ( $value < 1 || $value > 999 )
    355358                                        return;
  • wp-admin/includes/class-wp-plugins-list-table.php

     
    2020                if ( $status != $default_status && 'search' != $status )
    2121                        update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
    2222
     23                $page = $this->get_pagenum();
     24
    2325                parent::WP_List_Table( array(
    2426                        'plural' => 'plugins',
    2527                ) );
     
    5557                        'dropins' => array()
    5658                );
    5759
    58                 if ( ! is_multisite() || ( is_network_admin() && current_user_can('manage_network_plugins') ) ) {
     60                if ( ! is_multisite() || ( $this->_screen->is_network && current_user_can('manage_network_plugins') ) ) {
    5961                        if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
    6062                                $plugins['mustuse'] = get_mu_plugins();
    6163                        if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
     
    8385
    8486                foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
    8587                        // Filter into individual sections
    86                         if ( is_plugin_active_for_network($plugin_file) && !is_network_admin() ) {
     88                        if ( is_plugin_active_for_network($plugin_file) && !$this->_screen->is_network ) {
    8789                                unset( $plugins['all'][ $plugin_file ] );
    8890                                continue;
    8991                        } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) {
    9092                                $plugins['network'][ $plugin_file ] = $plugin_data;
    91                         } elseif ( ( !is_network_admin() && is_plugin_active( $plugin_file ) )
    92                                 || ( is_network_admin() && is_plugin_active_for_network( $plugin_file ) ) ) {
     93                        } elseif ( ( !$this->_screen->is_network && is_plugin_active( $plugin_file ) )
     94                                || ( $this->_screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
    9395                                $plugins['active'][ $plugin_file ] = $plugin_data;
    9496                        } else {
    95                                 if ( !is_network_admin() && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
     97                                if ( !$this->_screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
    9698                                        $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
    9799                                $plugins['inactive'][ $plugin_file ] = $plugin_data;
    98100                        }
     
    126128                        uasort( $this->items, array( &$this, '_order_callback' ) );
    127129                }
    128130
    129                 $plugins_per_page = $this->get_items_per_page( 'plugins_per_page', 999 );
     131                $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->_screen->id}_per_page" ) );
    130132
    131133                $start = ( $page - 1 ) * $plugins_per_page;
    132134
     
    252254                $actions = array();
    253255
    254256                if ( 'active' != $status ) {
    255                         $action = is_network_admin() ? 'network-activate-selected' : 'activate-selected';
     257                        $action = $this->_screen->is_network ? 'network-activate-selected' : 'activate-selected';
    256258                        $actions[ $action ] = __( 'Activate' );
    257259                }
    258260
    259261                if ( 'inactive' != $status && 'recent' != $status )
    260262                        $actions['deactivate-selected'] = __( 'Deactivate' );
    261263
    262                 if ( !is_multisite() || is_network_admin() ) {
     264                if ( !is_multisite() || $this->_screen->is_network ) {
    263265                        if ( current_user_can( 'update_plugins' ) )
    264266                                $actions['update-selected'] = __( 'Update' );
    265267                        if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
     
    311313                        );
    312314
    313315                        if ( 'mustuse' == $context ) {
    314                                 if ( is_multisite() && !is_network_admin() )
     316                                if ( is_multisite() && !$this->_screen->is_network )
    315317                                        continue;
    316318                                $is_active = true;
    317319                        } elseif ( 'dropins' == $context ) {
    318                                 if ( is_multisite() && !is_network_admin() )
     320                                if ( is_multisite() && !$this->_screen->is_network )
    319321                                        continue;
    320322                                $dropins = _get_dropins();
    321323                                $plugin_name = $plugin_file;
     
    335337                                        $description .= '<p>' . $plugin_data['Description'] . '</p>';
    336338                        } else {
    337339                                $is_active_for_network = is_plugin_active_for_network($plugin_file);
    338                                 if ( is_network_admin() )
     340                                if ( $this->_screen->is_network )
    339341                                        $is_active = $is_active_for_network;
    340342                                else
    341343                                        $is_active = is_plugin_active( $plugin_file );
    342344
    343                                 if ( $is_active_for_network && !is_super_admin() && !is_network_admin() )
     345                                if ( $is_active_for_network && !is_super_admin() && !$this->_screen->is_network )
    344346                                        continue;
    345347
    346                                 if ( is_network_admin() ) {
     348                                if ( $this->_screen->is_network ) {
    347349                                        if ( $is_active_for_network ) {
    348350                                                if ( current_user_can( 'manage_network_plugins' ) )
    349351                                                        $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;networkwide=1&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
     
    357359                                        if ( $is_active ) {
    358360                                                $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
    359361                                        } else {
    360                                                 if ( is_network_only_plugin( $plugin_file ) && !is_network_admin() )
     362                                                if ( is_network_only_plugin( $plugin_file ) && !$this->_screen->is_network )
    361363                                                        continue;
    362364
    363365                                                $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
     
    365367                                                if ( ! is_multisite() && current_user_can('delete_plugins') )
    366368                                                        $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
    367369                                        } // end if $is_active
    368                                  } // end if is_network_admin()
     370                                 } // end if $this->_screen->is_network
    369371
    370372                                if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
    371373                                        $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
  • wp-admin/network/themes.php

     
    6060$wp_list_table->prepare_items();
    6161add_thickbox();
    6262
    63 add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' ), 'default' => 999) );
     63add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) );
    6464
    6565add_contextual_help($current_screen,
    6666        '<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
  • wp-admin/plugins.php

     
    296296wp_enqueue_script('plugin-install');
    297297add_thickbox();
    298298
    299 add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' ), 'default' => 999) );
     299add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' )) );
    300300
    301301add_contextual_help($current_screen,
    302302        '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .