Make WordPress Core


Ignore:
Timestamp:
01/03/2015 08:23:06 AM (10 years ago)
Author:
wonderboymusic
Message:

Respect query vars for taxonomies passed as URL parameters when in grid mode of Media Library.

Fixes #30584.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r31029 r31037  
    21602160
    21612161    $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array();
    2162     $query = array_intersect_key( $query, array_flip( array(
     2162    $keys = array(
    21632163        's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type',
    21642164        'post_parent', 'post__in', 'post__not_in', 'year', 'monthnum'
    2165     ) ) );
    2166 
     2165    );
     2166    foreach ( get_taxonomies_for_attachments( 'objects' ) as $t ) {
     2167        if ( $t->query_var && isset( $query[ $t->query_var ] ) ) {
     2168            $keys[] = $t->query_var;
     2169        }
     2170    }
     2171
     2172    $query = array_intersect_key( $query, array_flip( $keys ) );
    21672173    $query['post_type'] = 'attachment';
    21682174    if ( MEDIA_TRASH
Note: See TracChangeset for help on using the changeset viewer.