[wp-trac] [WordPress Trac] #43591: WordPress REST 2.0 - Media/Post orderby=order

WordPress Trac noreply at wordpress.org
Tue Mar 20 20:48:04 UTC 2018


#43591: WordPress REST 2.0 - Media/Post orderby=order
-----------------------------+-----------------------------
 Reporter:  spiritofelric    |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  REST API         |    Version:  4.9.4
 Severity:  normal           |   Keywords:
  Focuses:  rest-api         |
-----------------------------+-----------------------------
 Is it possible to update Media requests to orderby the order field in the
 post table?  It looks like it's already indexed for this purpose.

 Seems easy to do:
 wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
 +881:                           'order'         => 'post_order',
 + 2163:                                 'order',


 This would be useful for queries such as:
 http://wpdistillery.vm/wp-json/wp/v2/media?parent=121&orderby=order


 Thanks

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


More information about the wp-trac mailing list