WordPress.org

Make WordPress Core

Changeset 11027


Ignore:
Timestamp:
04/21/09 06:49:53 (6 years ago)
Author:
ryan
Message:

Add per page screen option to plugins page. see #9527

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r10988 r11027  
    346346            case 'categories_per_page': 
    347347            case 'edit_tags_per_page': 
     348            case 'plugins_per_page': 
    348349                $value = (int) $value; 
    349350                if ( $value < 1 || $value > 999 ) 
  • trunk/wp-admin/includes/template.php

    r11026 r11027  
    33523352        $screen = $meta_screens[$screen]; 
    33533353    $show_screen = false; 
    3354     if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) 
     3354    $show_on_screen = false; 
     3355    if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) { 
     3356        $show_screen = true; 
     3357        $show_on_screen = true; 
     3358    } 
     3359 
     3360    $screen_options = screen_options($screen); 
     3361    if ( $screen_options ) 
    33553362        $show_screen = true; 
    33563363 
     
    34043411<div id="screen-options-wrap" class="hidden"> 
    34053412    <form id="adv-settings" action="" method="post"> 
     3413<?php if ( $show_on_screen ) : ?> 
    34063414    <h5><?php _e('Show on screen') ?></h5> 
    34073415    <div class="metabox-prefs"> 
     
    34133421    <br class="clear" /> 
    34143422    </div> 
     3423<?php endif; ?> 
    34153424<?php echo screen_layout($screen); ?> 
    3416 <?php echo screen_options($screen); ?> 
     3425<?php echo $screen_options; ?> 
    34173426<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div> 
    34183427</form> 
     
    35563565            $per_page_label = __('Tags per page:'); 
    35573566            break; 
     3567        case 'plugins': 
     3568            $per_page_label = __('Plugins per page:'); 
     3569            break; 
    35583570        default: 
    35593571            return ''; 
     
    35693581    if ( !empty($per_page_label) ) 
    35703582        $return .= "<label for='$option'>$per_page_label</label> <input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' />\n"; 
    3571         $return .= "<input type='submit' class='button' value='" . __('Apply') . "' />"; 
    3572         $return .= "<input type='hidden' name='wp_screen_options[option]' value='$option' />"; 
     3583    $return .= "<input type='submit' class='button' value='" . __('Apply') . "' />"; 
     3584    $return .= "<input type='hidden' name='wp_screen_options[option]' value='$option' />"; 
    35733585    $return .= "</div>\n"; 
    35743586    return $return; 
  • trunk/wp-admin/plugins.php

    r11014 r11027  
    207207<div class="wrap"> 
    208208<?php screen_icon(); ?> 
    209     <h2><?php echo wp_specialchars( $title ); ?></h2> 
     209<h2><?php echo wp_specialchars( $title ); ?></h2> 
     210 
     211<p><?php _e('Plugins extend and expand the functionality of WordPress. Install new plugins and then activate, deactivate, or delete them here.'); ?></p> 
    210212 
    211213<?php 
     
    285287$total_this_page = "total_{$status}_plugins"; 
    286288$total_this_page = $$total_this_page; 
    287 $plugins_per_page = apply_filters('plugins_per_page', 20, $status); 
     289$plugins_per_page = get_user_option('plugins_per_page'); 
     290if ( empty($plugins_per_page) ) 
     291    $plugins_per_page = 20; 
     292$plugins_per_page = apply_filters('plugins_per_page', $plugins_per_page); 
    288293 
    289294$start = ($page - 1) * $plugins_per_page; 
Note: See TracChangeset for help on using the changeset viewer.