Obey post_type. Props filosofo. fixes #8872

git-svn-id: https://develop.svn.wordpress.org/trunk@10503 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-02-04 20:32:27 +00:00
parent 7bf2f59881
commit 4ad180ca5b
1 changed files with 3 additions and 3 deletions

View File

@ -2064,14 +2064,14 @@ class WP_Query {
$q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
}
if ( $this->is_attachment ) {
if ( 'any' == $post_type ) {
$where .= '';
} elseif ( $this->is_attachment ) {
$where .= " AND $wpdb->posts.post_type = 'attachment'";
} elseif ($this->is_page) {
$where .= " AND $wpdb->posts.post_type = 'page'";
} elseif ($this->is_single) {
$where .= " AND $wpdb->posts.post_type = 'post'";
} elseif ( 'any' == $post_type ) {
$where .= '';
} else {
$where .= " AND $wpdb->posts.post_type = '$post_type'";
}