Changeset 31696 for trunk/src/wp-admin/includes/screen.php
- Timestamp:
- 03/10/2015 03:31:54 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/screen.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/screen.php
r31200 r31696 1128 1128 */ 1129 1129 public function render_per_page_options() { 1130 if ( ! $this->get_option( 'per_page' ) )1130 if ( null === $this->get_option( 'per_page' ) ) { 1131 1131 return; 1132 } 1132 1133 1133 1134 $per_page_label = $this->get_option( 'per_page', 'label' ); 1135 if ( null === $per_page_label ) { 1136 $per_page_label = __( 'Number of items per page:' ); 1137 } 1134 1138 1135 1139 $option = $this->get_option( 'per_page', 'option' ); 1136 if ( ! $option ) 1140 if ( ! $option ) { 1137 1141 $option = str_replace( '-', '_', "{$this->id}_per_page" ); 1142 } 1138 1143 1139 1144 $per_page = (int) get_user_option( $option ); 1140 1145 if ( empty( $per_page ) || $per_page < 1 ) { 1141 1146 $per_page = $this->get_option( 'per_page', 'default' ); 1142 if ( ! $per_page ) 1147 if ( ! $per_page ) { 1143 1148 $per_page = 20; 1149 } 1144 1150 } 1145 1151 … … 1166 1172 <div class="screen-options"> 1167 1173 <?php if ( $per_page_label ) : ?> 1174 <label for="<?php echo esc_attr( $option ); ?>"><?php echo $per_page_label; ?></label> 1168 1175 <input type="number" step="1" min="1" max="999" class="screen-per-page" name="wp_screen_options[value]" 1169 1176 id="<?php echo esc_attr( $option ); ?>" maxlength="3" 1170 1177 value="<?php echo esc_attr( $per_page ); ?>" /> 1171 <label for="<?php echo esc_attr( $option ); ?>">1172 <?php echo esc_html( $per_page_label ); ?>1173 </label>1174 1178 <?php endif; 1175 1179 1176 1180 echo get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false ); ?> 1177 <input type= 'hidden' name='wp_screen_options[option]' value='<?php echo esc_attr($option); ?>'/>1181 <input type="hidden" name="wp_screen_options[option]" value="<?php echo esc_attr( $option ); ?>" /> 1178 1182 </div> 1179 1183 <?php
Note: See TracChangeset
for help on using the changeset viewer.