WordPress.org

Make WordPress Core

#43753 closed defect (bug) (invalid)

Media Grid does not respect taxonomy URL parameters

Reported by: mclaurent Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.5
Component: General Keywords: reporter-feedback
Focuses: Cc:
PR Number:

Description

The media items are correctly filtered on the list page but the grid view does apparently not take the taxonomy filter into account.

The list view was fixed in https://core.trac.wordpress.org/ticket/30584

Environment

  • WAMP
  • WP 4.9.5
  • Twenty Seventeen
  • PHP 7.1
  • 10.0.19-MariaDB

Steps to reproduce

Add a category to the media by adding this to functions.php

<?php
add_action( 'init', 'jw_tax' );
function jw_tax(){
        register_taxonomy( 'media_cats', 'attachment', array(
                'label' => __( 'Media Categories', 'jw' ),
                'hierarchical' => true,
        ));
}

Same steps as the other ticket.

  1. Upload an attachment via Media > Add New
  2. Edit the attachment and add to new category
  3. Add more media but don't attach to the category.
  4. Go to the Media > Media categories, click on the number in the final column (1)
  5. You are redirected to the grid view of the media section. Note all items are showed.
  6. Switch to the list view and see the filter is applied correctly.

Attachments (2)

gridview.jpg (152.1 KB) - added by mclaurent 19 months ago.
Media grid view with taxonomy filter
listview.jpg (79.4 KB) - added by mclaurent 19 months ago.
Media list view with taxonomy filter

Download all attachments as: .zip

Change History (6)

@mclaurent
19 months ago

Media grid view with taxonomy filter

@mclaurent
19 months ago

Media list view with taxonomy filter

#1 @mclaurent
19 months ago

  • Version set to 4.9.5

#2 @soulseekah
19 months ago

  • Keywords reporter-feedback added

Interesting.

I could not reproduce on my setup. The URL is also different being /wp-admin/upload.php?media_cats=one&post_type=attachment&mode=list. What am I missing?

#3 @mclaurent
19 months ago

Figured it out. My custom taxonomy had 'query_var' => false which was preventing it from applying in the query. Thank you for double-checking!

#4 @soulseekah
19 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.