[wp-trac] [WordPress Trac] #63339: WordPress 6.8 REST API returns all sticky posts regardless of per_page setting

WordPress Trac noreply at wordpress.org
Thu Apr 24 12:07:24 UTC 2025


#63339: WordPress 6.8 REST API returns all sticky posts regardless of per_page
setting
--------------------------+------------------------
 Reporter:  se8820726     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  6.8.1
Component:  REST API      |     Version:  6.8
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------
Changes (by SirLouen):

 * keywords:  has-patch needs-testing =>
 * status:  new => closed
 * resolution:   => duplicate


Comment:

 == Test Report
 === Description
 ❌ This report can't validate the indicated patch works as expected.

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

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

 === Actual Results
 1. ✅ The reported issue is solved with the patch
 1. ❌ There is a more general issue that this patch is not handling, see
 additional notes for more info

 === Additional Notes
 - The problem is correlated with this ticket #63307
 - Sticky posts have gone wild in 6.8 after #59801 as @wildworks suggested.
 - I've added some unit tests here: https://github.com/WordPress/wordpress-
 develop/pull/8731
 - The solution, introduced in this patch, only sorts this very specific
 case. But the per_page limit is actually working fine, the only problem is
 that the `ignore_sticky_posts` is adding sticky posts on top of any REST
 API query for posts, this is why it's surpassing the limit.
 - **Conclusion**: If the general issue is solved, all the tickets
 regarding this topic will be solved.

 Marking this as duplicate, follow patch release in #63307

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


More information about the wp-trac mailing list