[wp-trac] [WordPress Trac] #39055: REST API: order is ignored when orderby is set to include
WordPress Trac
noreply at wordpress.org
Sun Feb 12 18:13:59 UTC 2017
#39055: REST API: order is ignored when orderby is set to include
--------------------------------------+----------------------
Reporter: joshlevinson | Owner: jnylen0
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: Query | Version:
Severity: normal | Resolution: wontfix
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+----------------------
Changes (by jnylen0):
* keywords: has-patch has-unit-tests needs-refresh => has-patch has-unit-
tests
* status: accepted => closed
* resolution: => wontfix
* milestone: 4.8 =>
Comment:
Thanks for sticking with this one, @fibonaccina. I've committed the new
tests.
I've also updated the `WP_Query` sort order docs with
[https://codex.wordpress.org/index.php?title=Class_Reference%2FWP_Query&action=historysubmit&diff=159836&oldid=159831
a few changes] resulting from a review of the docs vs the code and the
[https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes/class-
wp-query.php?marks=1507-1508#L689 inline documentation]:
- Document the (lack of) interaction between `orderby` and `order` for
`post__in` and similar parameters. This is a bit counter-intuitive but I
believe it to be the best design overall, for reasons discussed above.
- Document the fact that `post_*`
[https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes/class-
wp-query.php?marks=1507-1508#L1492 is accepted] as well as `*` for many
parameters (for example `name`, `author`).
- Document `RAND(x)` as well as `rand`.
With that done, and some test cases added, I'm going to close out this
ticket.
Finally, I'd also accept similar test cases for `post_name__in` and
`post_parent__in`, whether attached to this ticket or a new one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39055#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list