Allow per_page settings for custom post type edit screens. see #9674
git-svn-id: https://develop.svn.wordpress.org/trunk@12707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0e4bc929a1
commit
2a68d3919d
|
@ -399,7 +399,13 @@ function set_screen_options() {
|
|||
|
||||
$option = str_replace('-', '_', $option);
|
||||
|
||||
switch ( $option ) {
|
||||
$map_option = $option;
|
||||
$type = str_replace('edit_', '', $map_option);
|
||||
$type = str_replace('_per_page', '', $type);
|
||||
if ( in_array($type, get_post_types()) )
|
||||
$map_option = 'edit_per_page';
|
||||
|
||||
switch ( $map_option ) {
|
||||
case 'edit_per_page':
|
||||
case 'edit_pages_per_page':
|
||||
case 'edit_comments_per_page':
|
||||
|
|
|
@ -851,6 +851,10 @@ function wp_edit_posts_query( $q = false ) {
|
|||
$orderby = 'date';
|
||||
}
|
||||
|
||||
if ( 'post' != $post_type )
|
||||
$per_page = 'edit_' . $post_type . '_per_page';
|
||||
else
|
||||
$per_page = 'edit_per_page';
|
||||
$posts_per_page = (int) get_user_option( 'edit_per_page' );
|
||||
if ( empty( $posts_per_page ) || $posts_per_page < 1 )
|
||||
$posts_per_page = 15;
|
||||
|
|
Loading…
Reference in New Issue