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
This commit is contained in:
dd32 2010-04-07 08:29:46 +00:00
parent 736d80e1c0
commit fedd1a12d4

View File

@ -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 ]) )