mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 10:02:43 +01:00
Account for taxonomies tied to specific kinds of attachments when setting up post types for a taxonomy query.
props jondavidjohn. see #21290. git-svn-id: https://develop.svn.wordpress.org/trunk@22718 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2e6be2d063
commit
628778d7c1
@ -2224,7 +2224,8 @@ class WP_Query {
|
||||
$post_type = array();
|
||||
$taxonomies = wp_list_pluck( $this->tax_query->queries, 'taxonomy' );
|
||||
foreach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) {
|
||||
if ( array_intersect( $taxonomies, get_object_taxonomies( $pt ) ) )
|
||||
$object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt );
|
||||
if ( array_intersect( $taxonomies, $object_taxonomies ) )
|
||||
$post_type[] = $pt;
|
||||
}
|
||||
if ( ! $post_type )
|
||||
|
Loading…
x
Reference in New Issue
Block a user