Retore p_status. see #9674

git-svn-id: http://svn.automattic.com/wordpress/trunk@13049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-10 20:37:18 +00:00
parent 561bb70bb7
commit ca45669343
2 changed files with 7 additions and 3 deletions

View File

@ -2102,10 +2102,14 @@ class WP_Query {
$r_status[] = "$wpdb->posts.post_status <> 'trash'"; $r_status[] = "$wpdb->posts.post_status <> 'trash'";
} else { } else {
foreach ( get_post_stati() as $status ) { foreach ( get_post_stati() as $status ) {
if ( in_array( $status, $q_status ) ) if ( in_array( $status, $q_status ) ) {
if ( 'private' == $status )
$p_status[] = "$wpdb->posts.post_status = '$status'";
else
$r_status[] = "$wpdb->posts.post_status = '$status'"; $r_status[] = "$wpdb->posts.post_status = '$status'";
} }
} }
}
if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) { if ( empty($q['perm'] ) || 'readable' != $q['perm'] ) {
$r_status = array_merge($r_status, $p_status); $r_status = array_merge($r_status, $p_status);