Changeset 13695
- Timestamp:
- 03/13/2010 08:01:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r13653 r13695 2903 2903 'meta_key' => '', 'meta_value' => '', 2904 2904 'authors' => '', 'parent' => -1, 'exclude_tree' => '', 2905 'number' => '', 'offset' => 0 2905 'number' => '', 'offset' => 0, 2906 'post_type' => 'page', 'post_status' => 'publish', 2906 2907 ); 2907 2908 … … 2910 2911 $number = (int) $number; 2911 2912 $offset = (int) $offset; 2913 2914 // Make sure the post type is hierarchical 2915 $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) ); 2916 if ( !in_array( $post_type, $hierarchical_post_types ) ) 2917 return false; 2918 2919 // Make sure we have a valid post status 2920 if ( !in_array($post_status, get_post_stati()) ) 2921 return false; 2912 2922 2913 2923 $cache = array(); … … 3002 3012 if ( $parent >= 0 ) 3003 3013 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 3004 3005 $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where "; 3014 3015 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3016 3017 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3006 3018 $query .= $author_query; 3007 3019 $query .= " ORDER BY " . $sort_column . " " . $sort_order ;
Note: See TracChangeset
for help on using the changeset viewer.