Use canonical status list. see #9674

git-svn-id: https://develop.svn.wordpress.org/trunk@12995 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-02-06 17:51:24 +00:00
parent 68db07fb9b
commit a14ee51cad
1 changed files with 4 additions and 14 deletions

View File

@ -2100,20 +2100,10 @@ class WP_Query {
// @todo Use register_post_status() data to determine which states should be excluded. // @todo Use register_post_status() data to determine which states should be excluded.
$r_status[] = "$wpdb->posts.post_status <> 'trash'"; $r_status[] = "$wpdb->posts.post_status <> 'trash'";
} else { } else {
if ( in_array( 'draft' , $q_status ) ) foreach ( get_post_stati() as $status ) {
$r_status[] = "$wpdb->posts.post_status = 'draft'"; if ( in_array( $status, $q_status ) )
if ( in_array( 'pending', $q_status ) ) $r_status[] = "$wpdb->posts.post_status = '$status'";
$r_status[] = "$wpdb->posts.post_status = 'pending'"; }
if ( in_array( 'future' , $q_status ) )
$r_status[] = "$wpdb->posts.post_status = 'future'";
if ( in_array( 'inherit' , $q_status ) )
$r_status[] = "$wpdb->posts.post_status = 'inherit'";
if ( in_array( 'private', $q_status ) )
$p_status[] = "$wpdb->posts.post_status = 'private'";
if ( in_array( 'publish', $q_status ) )
$r_status[] = "$wpdb->posts.post_status = 'publish'";
if ( in_array( 'trash', $q_status ) )
$r_status[] = "$wpdb->posts.post_status = 'trash'";
} }
if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) { if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {