Changeset 12728 for trunk/wp-admin/includes/post.php
- Timestamp:
- 01/15/2010 04:58:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r12719 r12728 820 820 $post_stati = get_post_stati(); 821 821 822 if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types( array('_show' => true)) ) )822 if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types() ) ) 823 823 $post_type = $q['post_type']; 824 824 else 825 825 $post_type = 'post'; 826 $post_type_object = get_post_type_object($post_type); 826 827 827 828 $avail_post_stati = get_available_post_statuses($post_type); … … 843 844 } 844 845 845 if ( 'post' != $post_type ) 846 $per_page = 'edit_' . $post_type . '_per_page'; 847 else 848 $per_page = 'edit_per_page'; 849 $posts_per_page = (int) get_user_option( 'edit_per_page' ); 846 $per_page = 'edit_' . $post_type . '_per_page'; 847 $posts_per_page = (int) get_user_option( $per_page ); 850 848 if ( empty( $posts_per_page ) || $posts_per_page < 1 ) 851 849 $posts_per_page = 15; 852 $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page ); 853 854 wp( compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page') ); 850 $posts_per_page = apply_filters( $per_page, $posts_per_page ); 851 852 853 $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page'); 854 855 // Hierarchical types require special args. 856 if ( $post_type_object->hierarchical ) { 857 $query['orderby'] = 'menu_order title'; 858 $query['order'] = 'asc'; 859 $query['posts_per_page'] = -1; 860 $query['posts_per_archive_page'] = -1; 861 } 862 863 wp( $query ); 855 864 856 865 return $avail_post_stati;
Note: See TracChangeset
for help on using the changeset viewer.