From e28019c1ec60f1b8618bb1782e1c74a8dab82cc1 Mon Sep 17 00:00:00 2001 From: Dion Hulse 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: https://develop.svn.wordpress.org/trunk@14027 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 5e8ffc9be3..f9e30fda41 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 ]) )