Ticket #26869: perpage.2.diff
File perpage.2.diff, 1.9 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/post.php
949 949 elseif ( isset($q['post_status']) && 'pending' == $q['post_status'] ) 950 950 $order = 'ASC'; 951 951 952 $per_page = 'edit_' . $post_type . '_per_page';952 $per_page = "edit_{$post_type}_per_page"; 953 953 $posts_per_page = (int) get_user_option( $per_page ); 954 954 if ( empty( $posts_per_page ) || $posts_per_page < 1 ) 955 955 $posts_per_page = 20; … … 957 957 /** 958 958 * Filter the number of items per page to show for a specific 'per_page' type. 959 959 * 960 * The dynamic hook name, $per_page, refers to a hook name comprised of the post type, 961 * preceded by 'edit_', and succeeded by '_per_page', e.g. 'edit_$post_type_per_page'. 960 * The dynamic portion of the hook name, $post_type, refers to the post type. 962 961 * 963 962 * Some examples of filter hooks generated here include: 'edit_attachment_per_page', 964 963 * 'edit_post_per_page', 'edit_page_per_page', etc. 965 964 * 966 965 * @since 3.0.0 967 966 * 968 * @param int $posts_per_page Number of posts to display per page for the given 'per_page'967 * @param int $posts_per_page Number of posts to display per page for the given post 969 968 * type. Default 20. 970 969 */ 971 $posts_per_page = apply_filters( $per_page, $posts_per_page );970 $posts_per_page = apply_filters( "edit_{$post_type}_per_page", $posts_per_page ); 972 971 973 972 /** 974 973 * Filter the number of posts displayed per page when specifically listing "posts". 975 974 * 976 975 * @since 2.8.0 977 976 * 978 * @param int $p er_pageNumber of posts to be displayed. Default 20.979 * @param string $post_type The post type.977 * @param int $posts_per_page Number of posts to be displayed. Default 20. 978 * @param string $post_type The post type. 980 979 */ 981 980 $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type ); 982 981