mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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:
parent
0c81ddb8d2
commit
85e1fa1d99
@ -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'";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user