From 85e1fa1d99107485d4bec28258b3d63a6b5ad496 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 4 Feb 2009 20:32:27 +0000 Subject: [PATCH] Obey post_type. Props filosofo. fixes #8872 git-svn-id: http://svn.automattic.com/wordpress/trunk@10503 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 96f795bbd..3f0d13dbf 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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'"; }