Make WordPress Core

Changeset 22718


Ignore:
Timestamp:
11/20/2012 05:33:21 PM (12 years ago)
Author:
nacin
Message:

Account for taxonomies tied to specific kinds of attachments when setting up post types for a taxonomy query.

props jondavidjohn. see #21290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r22634 r22718  
    22252225                $taxonomies = wp_list_pluck( $this->tax_query->queries, 'taxonomy' );
    22262226                foreach ( get_post_types( array( 'exclude_from_search' => false ) ) as $pt ) {
    2227                     if ( array_intersect( $taxonomies, get_object_taxonomies( $pt ) ) )
     2227                    $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies( $pt );
     2228                    if ( array_intersect( $taxonomies, $object_taxonomies ) )
    22282229                        $post_type[] = $pt;
    22292230                }
Note: See TracChangeset for help on using the changeset viewer.