Always respect custom post_type in queries. props dd32, filosofo. fixes #10605

git-svn-id: https://develop.svn.wordpress.org/trunk@11817 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2009-08-15 03:28:03 +00:00
parent c4449d23b1
commit 14ac0702da
1 changed files with 2 additions and 2 deletions

View File

@ -2072,14 +2072,14 @@ class WP_Query {
if ( 'any' == $post_type ) {
$where .= " AND $wpdb->posts.post_type != 'revision'";
} elseif ( ! empty( $post_type ) ) {
$where .= " AND $wpdb->posts.post_type = '$post_type'";
} 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'";
} else {
$where .= " AND $wpdb->posts.post_type = '$post_type'";
}
if ( isset($q['post_status']) && '' != $q['post_status'] ) {