[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 18 16:29:42 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:  Awaiting
                                                |  Review
Component:  REST API                            |     Version:  6.8
 Severity:  normal                              |  Resolution:
 Keywords:  changes-requested has-testing-info  |     Focuses:  rest-api
------------------------------------------------+--------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing => changes-requested has-testing-info


Comment:

 == Patch Test Report
 === Description
 ❌ This report can't fully validate that the tested patch works as
 expected.

 Patch tested: https://github.com/WordPress/wordpress-
 develop/pull/8713.diff

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.4.6
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.4.6)
 - Browser: Chrome 135.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.0

 === Actual Results
 1. 🟠 The issue is resolved with the patch but new issues arise

 === Additional Notes
 The intention of that parameter is to keep sticky on top by default in the
 main REST json result
 http://localhost:8889/wp-json/wp/v2/posts
 By changing this param, you solve this issue, but now the sticky post
 won't appear on top of the full post list, which is the intention of such.

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


More information about the wp-trac mailing list