[wp-trac] [WordPress Trac] #63307: REST API: Returns incorrect post when querying by slug if sticky posts exist

WordPress Trac noreply at wordpress.org
Fri Apr 25 07:07:08 UTC 2025


#63307: REST API: Returns incorrect post when querying by slug if sticky posts
exist
-------------------------------------------------+-------------------------
 Reporter:  wpmudevsupport13                     |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.8.1
Component:  REST API                             |     Version:  6.8
 Severity:  critical                             |  Resolution:
 Keywords:  changes-requested has-testing-info   |     Focuses:  rest-api
  has-unit-tests dev-feedback has-patch          |
-------------------------------------------------+-------------------------

Comment (by jorbin):

 Confirmed using @SirLouen's tests that this is caused by [59801] so cc
 @peterwilsoncc, @audrasjb, @danielbachhuber, @joemcgill, @johnbillion,
 @jorbin (it's a me!), @mamaduka, @rmccue who all worked on that along with
 @spacedmonkey and @TimothyBlynJacobs who worked on
 [https://github.com/WordPress/gutenberg/pull/68970 the related GB PR]

 It should absolutely be fixed in 6.8.1, even if that means reverting
 [59801] which I would like to avoid if possible.

 RE: The two proposed solutions -

 https://github.com/WordPress/wordpress-develop/pull/8713 - I don't think
 this is feasible since it will cause sticky posts to need to be explictly
 requested which is a change in behavior (it's a bit concerning that no
 tests failed though)

 https://github.com/WordPress/wordpress-develop/pull/8730 - Something along
 these lines makes sense to me, though I would like for each of them to
 have some sort of test. I also think that this should use the WP_Query
 params, not the rest API version.

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


More information about the wp-trac mailing list