Changeset 17889
- Timestamp:
- 05/12/2011 03:53:46 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r17864 r17889 3323 3323 3324 3324 // Make sure we have a valid post status 3325 if ( !in_array($post_status, get_post_stati()) ) 3325 if ( !is_array( $post_status ) ) 3326 $post_status = explode( ',', $post_status ); 3327 if ( array_diff( $post_status, get_post_stati() ) ) 3326 3328 return false; 3327 3329 … … 3418 3420 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 3419 3421 3420 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3422 if ( 1 == count( $post_status ) ) { 3423 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $post_type, array_shift( $post_status ) ); 3424 } else { 3425 $post_status = implode( "', '", $post_status ); 3426 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $post_type ); 3427 } 3421 3428 3422 3429 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where ";
Note: See TracChangeset
for help on using the changeset viewer.