[wp-trac] [WordPress Trac] #38985: REST API: Some orderby parameters are broken

WordPress Trac noreply at wordpress.org
Tue Nov 29 23:34:35 UTC 2016


#38985: REST API: Some orderby parameters are broken
------------------------------------------+------------------
 Reporter:  jnylen0                       |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  4.7
Component:  REST API                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+------------------

Comment (by jnylen0):

 I haven't started on a patch for this yet.

 It looks like we can just map `id` → `ID` and `slug` → `name`, like we
 already do for `include` → `post__in`.  Presumably this is how it worked
 at one point.

 I think this issue shows that we also need to add tests for the actual SQL
 - using the `posts_orderby` filter seems like a good way to achieve this.
 In fact if we have that in place then we could probably drop the testing
 of results lists altogether which can be a bit tricky.

 I'm also wondering if there is similar breakage in the `orderby`
 parameters of other endpoints.

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


More information about the wp-trac mailing list