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:
parent
7bf2f59881
commit
4ad180ca5b
@ -2064,14 +2064,14 @@ class WP_Query {
|
|||||||
$q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
|
$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'";
|
$where .= " AND $wpdb->posts.post_type = 'attachment'";
|
||||||
} elseif ($this->is_page) {
|
} elseif ($this->is_page) {
|
||||||
$where .= " AND $wpdb->posts.post_type = 'page'";
|
$where .= " AND $wpdb->posts.post_type = 'page'";
|
||||||
} elseif ($this->is_single) {
|
} elseif ($this->is_single) {
|
||||||
$where .= " AND $wpdb->posts.post_type = 'post'";
|
$where .= " AND $wpdb->posts.post_type = 'post'";
|
||||||
} elseif ( 'any' == $post_type ) {
|
|
||||||
$where .= '';
|
|
||||||
} else {
|
} else {
|
||||||
$where .= " AND $wpdb->posts.post_type = '$post_type'";
|
$where .= " AND $wpdb->posts.post_type = '$post_type'";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user