Add per page screen option to plugins page. see #9527
git-svn-id: https://develop.svn.wordpress.org/trunk@11027 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3ff9ca71db
commit
493a97c532
|
@ -345,6 +345,7 @@ function set_screen_options() {
|
||||||
case 'upload_per_page':
|
case 'upload_per_page':
|
||||||
case 'categories_per_page':
|
case 'categories_per_page':
|
||||||
case 'edit_tags_per_page':
|
case 'edit_tags_per_page':
|
||||||
|
case 'plugins_per_page':
|
||||||
$value = (int) $value;
|
$value = (int) $value;
|
||||||
if ( $value < 1 || $value > 999 )
|
if ( $value < 1 || $value > 999 )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3351,7 +3351,14 @@ function screen_meta($screen) {
|
||||||
if ( isset($meta_screens[$screen]) )
|
if ( isset($meta_screens[$screen]) )
|
||||||
$screen = $meta_screens[$screen];
|
$screen = $meta_screens[$screen];
|
||||||
$show_screen = false;
|
$show_screen = false;
|
||||||
if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) )
|
$show_on_screen = false;
|
||||||
|
if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) {
|
||||||
|
$show_screen = true;
|
||||||
|
$show_on_screen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$screen_options = screen_options($screen);
|
||||||
|
if ( $screen_options )
|
||||||
$show_screen = true;
|
$show_screen = true;
|
||||||
|
|
||||||
if ( !isset($_wp_contextual_help) )
|
if ( !isset($_wp_contextual_help) )
|
||||||
|
@ -3403,6 +3410,7 @@ function screen_meta($screen) {
|
||||||
?>
|
?>
|
||||||
<div id="screen-options-wrap" class="hidden">
|
<div id="screen-options-wrap" class="hidden">
|
||||||
<form id="adv-settings" action="" method="post">
|
<form id="adv-settings" action="" method="post">
|
||||||
|
<?php if ( $show_on_screen ) : ?>
|
||||||
<h5><?php _e('Show on screen') ?></h5>
|
<h5><?php _e('Show on screen') ?></h5>
|
||||||
<div class="metabox-prefs">
|
<div class="metabox-prefs">
|
||||||
<?php
|
<?php
|
||||||
|
@ -3412,8 +3420,9 @@ function screen_meta($screen) {
|
||||||
?>
|
?>
|
||||||
<br class="clear" />
|
<br class="clear" />
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<?php echo screen_layout($screen); ?>
|
<?php echo screen_layout($screen); ?>
|
||||||
<?php echo screen_options($screen); ?>
|
<?php echo $screen_options; ?>
|
||||||
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
|
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3555,6 +3564,9 @@ function screen_options($screen) {
|
||||||
case 'edit-tags':
|
case 'edit-tags':
|
||||||
$per_page_label = __('Tags per page:');
|
$per_page_label = __('Tags per page:');
|
||||||
break;
|
break;
|
||||||
|
case 'plugins':
|
||||||
|
$per_page_label = __('Plugins per page:');
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,9 @@ if ( !empty($invalid) )
|
||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<?php screen_icon(); ?>
|
<?php screen_icon(); ?>
|
||||||
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
||||||
|
|
||||||
|
<p><?php _e('Plugins extend and expand the functionality of WordPress. Install new plugins and then activate, deactivate, or delete them here.'); ?></p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -284,7 +286,10 @@ $plugins = &$$plugin_array_name;
|
||||||
$page = isset($_GET['paged']) ? $_GET['paged'] : 1;
|
$page = isset($_GET['paged']) ? $_GET['paged'] : 1;
|
||||||
$total_this_page = "total_{$status}_plugins";
|
$total_this_page = "total_{$status}_plugins";
|
||||||
$total_this_page = $$total_this_page;
|
$total_this_page = $$total_this_page;
|
||||||
$plugins_per_page = apply_filters('plugins_per_page', 20, $status);
|
$plugins_per_page = get_user_option('plugins_per_page');
|
||||||
|
if ( empty($plugins_per_page) )
|
||||||
|
$plugins_per_page = 20;
|
||||||
|
$plugins_per_page = apply_filters('plugins_per_page', $plugins_per_page);
|
||||||
|
|
||||||
$start = ($page - 1) * $plugins_per_page;
|
$start = ($page - 1) * $plugins_per_page;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue