diff --git wp-includes/query.php wp-includes/query.php
index 443d0bb..5e97a22 100644
|
|
class WP_Query { |
2219 | 2219 | } |
2220 | 2220 | |
2221 | 2221 | if ( $this->is_tax ) { |
2222 | | if ( empty($post_type) ) { |
2223 | | // Do a fully inclusive search for currently registered post types of queried taxonomies |
2224 | | $post_type = array(); |
2225 | | $taxonomies = wp_list_pluck( $this->tax_query->queries, 'taxonomy' ); |
2226 | | foreach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) { |
2227 | | $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt ); |
2228 | | if ( array_intersect( $taxonomies, $object_taxonomies ) ) |
| 2222 | $post_types = empty( $post_type ) ? array( 'post' ) : (array) $post_type; |
| 2223 | |
| 2224 | $post_type = array(); |
| 2225 | $taxonomies = wp_list_pluck( $this->tax_query->queries, 'taxonomy' ); |
| 2226 | foreach ( $taxonomies as $t ) { |
| 2227 | foreach ( $post_types as $i => $pt ) { |
| 2228 | if ( is_object_in_taxonomy( $pt, $t ) && ! in_array( $pt, $post_type ) ) |
2229 | 2229 | $post_type[] = $pt; |
2230 | 2230 | } |
2231 | | if ( ! $post_type ) |
2232 | | $post_type = 'any'; |
| 2231 | } |
2233 | 2232 | |
| 2233 | if ( ! empty( $post_type ) ) { |
2234 | 2234 | $post_status_join = true; |
2235 | | } elseif ( in_array('attachment', (array) $post_type) ) { |
2236 | | $post_status_join = true; |
| 2235 | } else { |
| 2236 | $where = ' 0 = 1 AND' . $where; |
2237 | 2237 | } |
2238 | 2238 | } |
2239 | 2239 | |