[wp-trac] [WordPress Trac] #39947: REST API: Sticky post query returns unsticky posts when no posts are sticky
WordPress Trac
noreply at wordpress.org
Sat Feb 25 05:02:19 UTC 2017
#39947: REST API: Sticky post query returns unsticky posts when no posts are sticky
---------------------------------------------+----------------------
Reporter: ryelle | Owner: jnylen0
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.7.3
Component: REST API | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses:
---------------------------------------------+----------------------
Changes (by jnylen0):
* status: accepted => closed
* resolution: => fixed
Comment:
In [changeset:"40122"]:
{{{
#!CommitTicketReference repository="" revision="40122"
REST API: Fix behavior of `sticky` posts filter when no posts are sticky.
Previously, when getting posts from the API with `sticky=true`, if there
were no sticky posts set, the query would return all posts as if the
`sticky` argument was not set. In this situation, the query should return
an empty array instead.
A `sticky=true` query that should return an empty array (in the previous
situation, or with `include` and no intersecting post IDs) was also broken
in that it would query the post with ID 1.
Finally, this commit significantly improves test coverage for the `sticky`
filter argument, including direct testing of the `WHERE` clauses generated
by `WP_Query`.
Props ryelle.
Fixes #39947.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39947#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list