Obey post_type. Props filosofo. fixes #8872

git-svn-id: http://svn.automattic.com/wordpress/trunk@10503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-02-04 20:32:27 +00:00
parent 0c81ddb8d2
commit 85e1fa1d99

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'";
}