<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14157] trunk/wp-admin/includes/template.php: Change the 'per page'
screen options strings.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14157">14157</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-04-18 17:15:58 +0000 (Sun, 18 Apr 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Change the 'per page' screen options strings. fixes <a href="http://trac.wordpress.org/ticket/12872">#12872</a>, props caesarsgrunt.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (14156 => 14157)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-04-18 16:49:18 UTC (rev 14156)
+++ trunk/wp-admin/includes/template.php        2010-04-18 17:15:58 UTC (rev 14157)
</span><span class="lines">@@ -3581,11 +3581,8 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         $show_screen = false;
</span><del>-        $show_on_screen = false;
-        if ( !empty($wp_meta_boxes[$screen->id]) || !empty($column_screens) ) {
</del><ins>+        if ( !empty($wp_meta_boxes[$screen->id]) || !empty($column_screens) )
</ins><span class="cx">                 $show_screen = true;
</span><del>-                $show_on_screen = true;
-        }
</del><span class="cx">
</span><span class="cx">         $screen_options = screen_options($screen);
</span><span class="cx">         if ( $screen_options )
</span><span class="lines">@@ -3609,7 +3606,6 @@
</span><span class="cx"> ?>
</span><span class="cx"> <div id="screen-options-wrap" class="hidden">
</span><span class="cx">         <form id="adv-settings" action="" method="post">
</span><del>-<?php if ( $show_on_screen ) : ?>
</del><span class="cx">         <h5><?php _e('Show on screen') ?></h5>
</span><span class="cx">         <div class="metabox-prefs">
</span><span class="cx"> <?php
</span><span class="lines">@@ -3619,7 +3615,6 @@
</span><span class="cx"> ?>
</span><span class="cx">         <br class="clear" />
</span><span class="cx">         </div>
</span><del>-<?php endif; ?>
</del><span class="cx"> <?php echo screen_layout($screen); ?>
</span><span class="cx"> <?php echo $screen_options; ?>
</span><span class="cx"> <?php echo $settings; ?>
</span><span class="lines">@@ -3749,34 +3744,31 @@
</span><span class="cx">
</span><span class="cx">         switch ( $screen->base ) {
</span><span class="cx">                 case 'edit':
</span><del>-                        $per_page_label = __('Posts per page:');
-                        break;
</del><span class="cx">                 case 'edit-pages':
</span><del>-                        $per_page_label = __('Pages per page:');
</del><ins>+                        $post_type = 'post';
+                        if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) )
+                                $post_type = $_GET['post_type'];
+                        $post_type_object = get_post_type_object($post_type);
+                        $per_page_label = $post_type_object->label;
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'ms-sites':
</span><del>-                        $per_page_label = __('Sites per page:');
</del><ins>+                        $per_page_label = __('Sites');
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'ms-users':
</span><del>-                        $per_page_label = __('Users per page:');
</del><ins>+                        $per_page_label = __('Users');
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'edit-comments':
</span><del>-                        $per_page_label = __('Comments per page:');
</del><ins>+                        $per_page_label = __('Comments');
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'upload':
</span><del>-                        $per_page_label = __('Media items per page:');
</del><ins>+                        $per_page_label = __('Media items');
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'edit-tags':
</span><del>-                        global $taxonomy, $tax;
-                        if ( 'post_tag' == $taxonomy )
-                                $per_page_label = __('Tags per page:');
-                        elseif ( 'category' == $taxonomy )
-                                $per_page_label = __('Categories per page:');
-                        else
-                                $per_page_label = sprintf(_x('%s per page:', '%s: plural taxonomy name'), $tax->label);
</del><ins>+                        global $tax;
+                        $per_page_label = $tax->label;
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'plugins':
</span><del>-                        $per_page_label = __('Plugins per page:');
</del><ins>+                        $per_page_label = __('Plugins');
</ins><span class="cx">                         break;
</span><span class="cx">                 default:
</span><span class="cx">                         return '';
</span><span class="lines">@@ -3805,10 +3797,9 @@
</span><span class="cx">         else
</span><span class="cx">                 $per_page = apply_filters( $option, $per_page );
</span><span class="cx">
</span><del>-        $return = '<h5>' . __('Options') . "</h5>\n";
-        $return .= "<div class='screen-options'>\n";
</del><ins>+        $return = "<div class='screen-options'>\n";
</ins><span class="cx">         if ( !empty($per_page_label) )
</span><del>-                $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";
</del><ins>+                $return .= "<input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>\n";
</ins><span class="cx">         $return .= "<input type='submit' class='button' value='" . esc_attr__('Apply') . "' />";
</span><span class="cx">         $return .= "<input type='hidden' name='wp_screen_options[option]' value='" . esc_attr($option) . "' />";
</span><span class="cx">         $return .= "</div>\n";
</span></span></pre>
</div>
</div>
</body>
</html>