Opened 10 years ago
Closed 10 years ago
#30584 closed defect (bug) (fixed)
Media Manager - Grid view does not respect taxonomy URL parameters.
Reported by: | Phyrax | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.0.1 |
Component: | Media | Keywords: | has-patch |
Focuses: | javascript, administration | Cc: |
Description
The title pretty much explains the issue I've found. Current setup is as follows:
- XAMPP v3.1.0 Beta 6
- Wordpress 4.0.1
- No plugins active ( no mu-plugins either )
- Twenty Fourteen Theme v1.2
- PHP 5.4.7
- MySQL 5.5.27
Steps to reproduce
First and foremost you'll need to add this to your theme/plugin functions file:
Register taxonomy to attachments:
add_action( 'init', 'jw_tax' ); function jw_tax(){ register_taxonomy( 'media_cats', 'attachment', array( 'label' => __( 'Media Categories', 'jw' ), 'hierarchical' => true, )); }
Please excuse the neglected count callback to update attachment taxonomy counts.
- Upload an attachment via Media > Add New ( or use an existing image )
- Edit the attachment and add a term to it under the new Media Categories taxonomy and save.
- Upload a few extra images, but do not attach them to the taxonomy.
- Once saved, go to Media > Media Categories ( new taxonomy ), and click on the count number for that term
- It shows zero due to me not setting the count callback, ignore that as it's unrelated.
- You are then redirected to the media library with the url paramter. ( example: http://localhost/wordpress/wp-admin/upload.php?media_cats=testing&post_type=attachment )
- At this point if you're in list view, the library respects the media_cats url parameter and loads only the image you assigned to the term name
- If you switch to grid view, the grid shows all images and ignores the URL parameter.
NOTES
Regardless of switching between list and grid view, either before ( via user profile data ) or after the redirect to the library upon clicking the count number, grid view is just not responding to the URL parameters.
Essentially if the user is using the grid view, by default, there is no way for users to sort the library by taxonomy data. In lieu of that, we have used a plugin that adds a dropdown to the media toolbar for taxonomy stuff. This plugin, however, still does not help with the above issue of the grid view and URL parameters, but should provide a good starting point for someone.
The Plugin: https://wordpress.org/plugins/enhanced-media-library/
Thanks for the report, this was a fun one