[wp-trac] [WordPress Trac] #64073: Attachments REST API: extend to support ordering by `mime_type`.

WordPress Trac noreply at wordpress.org
Fri Oct 3 06:01:55 UTC 2025


#64073: Attachments REST API: extend to support ordering by `mime_type`.
-------------------------+-----------------------------
 Reporter:  ramonopoly   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  REST API     |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:  rest-api     |
-------------------------+-----------------------------
 To support dataviews tables it would be helpful to be able to sort a set
 of attachment results by `mime_type`.

 The means that the response results could be ordered ASC/DESC, eg.,


 {{{
 [
 { "mime_type": "image/gif", ... },
 { "mime_type": "video/mp4", ... },
 ]

 }}}





 This could be done by extending the `$params` in
 `WP_REST_Attachments_Controller::get_collection_params` with
 `$params['orderby']['enum'][] = 'mime_type';`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64073>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list