Ticket #19198: 19198.diff
| File 19198.diff, 889 bytes (added by , 14 years ago) |
|---|
-
wp-includes/query.php
2388 2388 if ( 'any' == $post_type ) { 2389 2389 $exclude_post_types = ''; 2390 2390 $in_search_post_types = get_post_types( array('exclude_from_search' => false) ); 2391 if ( ! empty( $in_search_post_types ) ) 2392 $where .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')"); 2391 $post_types = empty($in_search_post_types) ? 'null' : 2392 "'" . join("', '", $in_search_post_types ) . "'"; 2393 $where .= $wpdb->prepare(" AND $wpdb->posts.post_type IN ($post_types)"); 2393 2394 } elseif ( !empty( $post_type ) && is_array( $post_type ) ) { 2394 2395 $where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')"; 2395 2396 } elseif ( ! empty( $post_type ) ) {