[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
Wed Jul 9 06:59:47 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:4 nikunj8866]:
 > 🐞 **Bug Identified**: When running the endpoint `http://localhost:8889
 /wp-json/wp/v2/media?mime_type=video/mp4,` the API returns all media items
 instead of filtering to just video/mp4
 items(https://prnt.sc/uPL2rMgESFUx).

 Thanks @nikunj8866, for testing this out.

 However, my testing results were slightly different.
 I have `.mp4`, `.mov`, `.png`, and `.mp3` files in the media library.


 When I request - `http://localhost:8889/wp-
 json/wp/v2/media?mime_type=video/mp4`, then I get the expected results,
 which is a single item - `.mp4` file and not all the items.


 Here is a screencast of the same -
 [https://drive.google.com/file/d/1p9_kgdK83mtGHMppkfiwuW_8y70zjWhn/view?usp=sharing
 video]

 Could you please maybe checkout the PR and test to see if you're getting
 the expected results or not.

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


More information about the wp-trac mailing list