WordPress.org

Make WordPress Core

Ticket #14135: 14135.3.diff

File 14135.3.diff, 1.6 KB (added by wpmuguru, 9 years ago)
  • wp-admin/includes/post.php

     
    895895        $posts_per_page = (int) get_user_option( $per_page );
    896896        if ( empty( $posts_per_page ) || $posts_per_page < 1 )
    897897                $posts_per_page = 20;
     898
     899        $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
    898900        $posts_per_page = apply_filters( $per_page, $posts_per_page );
    899901
    900 
    901902        $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
    902903
    903904        // Hierarchical types require special args.
  • wp-admin/edit.php

     
    4343$pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
    4444if ( empty($pagenum) )
    4545        $pagenum = 1;
    46 $per_page = 'edit_' . $post_type . '_per_page';
    47 $per_page = (int) get_user_option( $per_page );
     46$edit_per_page = 'edit_' . $post_type . '_per_page';
     47$per_page = (int) get_user_option( $edit_per_page );
    4848if ( empty( $per_page ) || $per_page < 1 )
    4949        $per_page = 20;
    50 // @todo filter based on type
    51 $per_page = apply_filters( 'edit_posts_per_page', $per_page );
    5250
     51$per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
     52$per_page = apply_filters( $edit_per_page, $per_page );
     53
    5354// Handle bulk actions
    5455if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
    5556        check_admin_referer('bulk-posts');