[wp-trac] [WordPress Trac] #63307: REST API posts return 2 posts
WordPress Trac
noreply at wordpress.org
Fri Apr 18 09:01:06 UTC 2025
#63307: REST API posts return 2 posts
------------------------------+-----------------------------
Reporter: wpmudevsupport13 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 6.8
Severity: normal | Keywords:
Focuses: rest-api |
------------------------------+-----------------------------
It was mentioned here by one of the reddit users
https://www.reddit.com/r/Wordpress/comments/1k106qz/wordpress_68_bug_with_rest_api_posts_pulling/
And it seems the issue can be easily replicated:
1. Create new post: /test-post
2. Open this in a browser: https://example.com/wp-json/wp/v2/posts?slug
=test-post
At this point, multiple values will get the post slug and ID.
3. Create another new post: /second-test and make that post sticky
Visit again https://example.com/wp-json/wp/v2/posts?slug=test-post, and
this time, many values will get that /second-test slug and ID, where it
should still show /test-post.
If you create multiple sticky posts, the https://example.com/wp-
json/wp/v2/posts?slug=test-post will get the slug and ID from the sticky
post that has the newest published date.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63307>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list