Ticket #15970: 15970.diff
File 15970.diff, 2.9 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/class-wp-posts-list-table.php
93 93 94 94 $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts; 95 95 96 $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page');96 $per_page = $this->get_items_per_page( _convert_key_to_option( 'edit_' . $post_type . '_per_page' ) ); 97 97 $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type ); 98 98 99 99 if ( $this->hierarchical_display ) -
wp-admin/includes/post.php
916 916 elseif ( isset($q['post_status']) && 'pending' == $q['post_status'] ) 917 917 $order = 'ASC'; 918 918 919 $per_page = 'edit_' . $post_type . '_per_page';919 $per_page = _convert_key_to_option( 'edit_' . $post_type . '_per_page' ); 920 920 $posts_per_page = (int) get_user_option( $per_page ); 921 921 if ( empty( $posts_per_page ) || $posts_per_page < 1 ) 922 922 $posts_per_page = 20; -
wp-admin/includes/misc.php
310 310 return $out; 311 311 } 312 312 313 function _convert_key_to_option( $key ) { 314 return str_replace('-', '_', $key); 315 } 316 313 317 /** 314 318 * Saves option for number of rows when listing posts, pages, comments, etc. 315 319 * … … 328 332 if ( !preg_match( '/^[a-z_-]+$/', $option ) ) 329 333 return; 330 334 331 $option = str_replace('-', '_', $option);335 $option = _convert_key_to_option( $option ); 332 336 333 337 $map_option = $option; 334 338 $type = str_replace('edit_', '', $map_option); 335 339 $type = str_replace('_per_page', '', $type); 336 if ( in_array( $type, get_post_types()) )340 if ( in_array( $type, array_map( '_convert_key_to_option', get_post_types() ) ) ) 337 341 $map_option = 'edit_per_page'; 338 if ( in_array( $type, get_taxonomies()) )342 if ( in_array( $type, array_map( '_convert_key_to_option', get_taxonomies() ) ) ) 339 343 $map_option = 'edit_tags_per_page'; 340 344 341 342 345 switch ( $map_option ) { 343 346 case 'edit_per_page': 344 347 case 'users_per_page': -
wp-admin/includes/template.php
1878 1878 $per_page_label = $wp_current_screen_options['per_page']['label']; 1879 1879 1880 1880 if ( empty($wp_current_screen_options['per_page']['option']) ) { 1881 $option = str_replace( '-', '_',"{$screen->id}_per_page" );1881 $option = _convert_key_to_option( "{$screen->id}_per_page" ); 1882 1882 } else { 1883 1883 $option = $wp_current_screen_options['per_page']['option']; 1884 1884 }