Ticket #17592: 17592.patch
File 17592.patch, 1.2 KB (added by , 13 years ago) |
---|
-
wp-includes/query.php
2374 2374 } 2375 2375 2376 2376 $exclude_post_types = ''; 2377 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 2378 if ( ! empty( $in_search_post_types ) ) 2379 $exclude_post_types .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"); 2377 if ( is_search() ) { 2378 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 2379 if ( ! empty( $in_search_post_types ) ) 2380 $exclude_post_types .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"); 2381 } 2380 2382 2381 2383 if ( 'any' == $post_type ) { 2382 2384 $where .= $exclude_post_types; … … 2416 2418 $r_status = array(); 2417 2419 $p_status = array(); 2418 2420 $e_status = array(); 2419 if ( in_array('any', $q_status) ) {2421 if ( in_array('any', $q_status) && ! is_search() ) { 2420 2422 foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status ) 2421 2423 $e_status[] = "$wpdb->posts.post_status <> '$status'"; 2422 2424 } else {