[wp-trac] [WordPress Trac] #43656: Media attachment filter does not work after switching list mode to grid for image attachment filter

WordPress Trac noreply at wordpress.org
Sat Apr 21 18:06:12 UTC 2018


#43656: Media attachment filter does not work after switching list mode to grid for
image attachment filter
-----------------------------+------------------------------
 Reporter:  itzmekhokan      |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Media            |     Version:  4.9.4
 Severity:  major            |  Resolution:
 Keywords:  has-screenshots  |     Focuses:
-----------------------------+------------------------------
Changes (by netsurfer2705):

 * severity:  normal => major


Comment:

 I can confirm this bug!
 It is caused by the presence of the "attachment-filter" in the URL, if it
 has any value other than empty.

 The href attribute of the "view-switch" icon (id:'view-switch-grid') holds
 all the query parameters, which are then (falsely) used for the ajax
 query.
 And if the first query for grid view does have a value for "attachment-
 filter", then you'll never be able to see "all" media!

 BTW: The ajax query is also totally "buggy". Normally one should be able
 to change the $query parameter byy using the 'ajax_query_attachments_args'
 filter. But this will have no effect for most of the query parameters,
 because some of them are hardcoded elsewhere in core!!!

 So there is no easy fix for this. Because to get it right, I would also
 expect the mime-type selection drop-down to be set to choosen value from
 the list view (and of course to work for "all").

 Also one should think about the trash option (if enabled), where all other
 filters should be ignored.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43656#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list