From fedd1a12d400d4558c04c01710d7603a6168ac6a Mon Sep 17 00:00:00 2001 From: dd32 Date: Wed, 7 Apr 2010 08:29:46 +0000 Subject: [PATCH] Fix a case where $post_type = 'any' causes a large query to run without any specifications (post_name/limits/id/etc). See #12704 git-svn-id: http://svn.automattic.com/wordpress/trunk@14027 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 5e8ffc9be..f9e30fda4 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1712,7 +1712,7 @@ class WP_Query { if ( $q['day'] ) $where .= " AND DAYOFMONTH($wpdb->posts.post_date)='" . $q['day'] . "'"; - if ( !empty($q['post_type']) ) { + if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) { $_pt = is_array($q['post_type']) ? $q['post_type'] : array($q['post_type']); foreach ( $_pt as $_post_type ) { if ( empty($q[ $_post_type ]) )