[wp-trac] [WordPress Trac] #39037: Should REST API support multiple orderby values?

WordPress Trac noreply at wordpress.org
Sat Dec 3 16:48:58 UTC 2016


#39037: Should REST API support multiple orderby values?
-------------------------+------------------------------
 Reporter:  ChopinBach   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  REST API     |     Version:  4.6.1
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by ChopinBach):

 Replying to [comment:2 jnylen0]:
 > Is it possible to make this work via existing filters?

 Implementing multiple orderby values is not too difficult to implement.
 Doing the independent variation where some fields are ASC and some DESC
 would be considerably harder to put into the API. I am pretty sure you can
 do both by using multiple filters in the API.

 > Another question: do other object types (`WP_Comment_Query` etc) support
 this?

 From a quick look, it appears that only the standard `WP_Query` object
 supports multiple and independent orderby parameters.

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


More information about the wp-trac mailing list