diff --git a/wp-includes/query.php b/wp-includes/query.php
index 04286aa..7430260 100644
a
|
b
|
class WP_Query { |
2421 | 2421 | } |
2422 | 2422 | |
2423 | 2423 | if ( 'any' == $post_type ) { |
2424 | | $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); |
| 2424 | $in_search_post_types = $this->is_search() ? get_post_types( array( 'exclude_from_search' => false ) ) : get_post_types(); |
2425 | 2425 | if ( ! empty( $in_search_post_types ) ) |
2426 | 2426 | $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"; |
2427 | 2427 | } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { |
… |
… |
class WP_Query { |
2459 | 2459 | $r_status = array(); |
2460 | 2460 | $p_status = array(); |
2461 | 2461 | $e_status = array(); |
2462 | | if ( in_array('any', $q_status) ) { |
2463 | | foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status ) |
| 2462 | if ( in_array( 'any', $q_status ) ) { |
| 2463 | $stati = $this->is_search() ? get_post_stati( array( 'exclude_from_search' => true ) ) : get_post_stati(); |
| 2464 | foreach ( $stati as $status ) |
2464 | 2465 | $e_status[] = "$wpdb->posts.post_status <> '$status'"; |
2465 | 2466 | } else { |
2466 | 2467 | foreach ( get_post_stati() as $status ) { |