[wp-trac] [WordPress Trac] #14800: 'edit_posts_per_page' filter missing in 'wp-admin/includes/template.php'

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 7 13:22:58 UTC 2010


#14800: 'edit_posts_per_page' filter missing in 'wp-admin/includes/template.php'
----------------------------+-----------------------------------------------
 Reporter:  sorich87        |       Owner:  sorich87       
     Type:  defect (bug)    |      Status:  new            
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.0.1          
 Severity:  normal          |    Keywords:  has-patch      
----------------------------+-----------------------------------------------
 When I modify the default number of posts, e.g. to 30 posts per page, in
 the posts list with the following code, the number of posts per line is
 set to 30, but the screen option remains 20.

 function my_edit_post_per_page( $per_page, $post_type ) {

         if( !get_user_option( 'edit_' . $post_type . '_per_page' ) ) { //
 if the current user did not customize the setting
                 $per_page = 30; // set the number of rows in the table
         }
         return $per_page;
 }

 add_filter( 'edit_posts_per_page', 'my_edit_post_per_page' );

 The bug, does not occur when I use a post type specific filter
 'edit_post_per_page' or 'edit_page_per_page' e.g., instead of the global
 filter 'edit_post_per_page'.

 The attached patch fixes the issue.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14800>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list