Make WordPress Core

Ticket #19198: 19198.3.diff

File 19198.3.diff, 675 bytes (added by wonderboymusic, 13 years ago)
  • wp-includes/query.php

    diff --git a/wp-includes/query.php b/wp-includes/query.php
    index 04286aa..8e69fe2 100644
    a b class WP_Query { 
    24222422
    24232423                if ( 'any' == $post_type ) {
    24242424                        $in_search_post_types = get_post_types( array('exclude_from_search' => false) );
    2425                         if ( ! empty( $in_search_post_types ) )
     2425                        if ( empty( $in_search_post_types ) )
     2426                                $where .= ' AND 1=0 ';
     2427                        else   
    24262428                                $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')";
    24272429                } elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
    24282430                        $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";