[wp-trac] [WordPress Trac] #63668: Media / REST API: Support specifying multiple media types or mime types when listing media

WordPress Trac noreply at wordpress.org
Thu Jul 10 07:58:06 UTC 2025


#63668: Media / REST API: Support specifying multiple media types or mime types
when listing media
-------------------------------------------------+-------------------------
 Reporter:  talldanwp                            |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  REST API                             |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch changes-requested has-     |     Focuses:  rest-api
  unit-tests                                     |
-------------------------------------------------+-------------------------

Comment (by abcd95):

 Replying to [comment:7 nikunj8866]:
 > @abcd95 I just wanted to confirm, did you include a comma(,) at the end
 of the URL, like `http://localhost:8889/wp-
 json/wp/v2/media?mime_type=video/mp4,`?

 Thanks @nikunj8866, I think I missed this.

 The behaviour here, fetching all items, is expected according to the
 implementation before and after the patch. It is because (I think)
 whenever we apply some filter on the query, and the filter turns out to be
 invalid/broken, the query bypasses the filter and fetches items based on
 the rest of the non-broken/valid filters. As we can see here, all the
 items are fetched in an orderly manner since that filter is valid.

 So while the implementation mandates this behaviour, we can still debate
 this (as you mentioned in your test report) whether to return an empty set
 of results for invalid filters through this PR or handle this separately.

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


More information about the wp-trac mailing list