[wp-trac] [WordPress Trac] #55444: Sticky posts are limited to 5

WordPress Trac noreply at wordpress.org
Wed Mar 23 16:15:10 UTC 2022


#55444: Sticky posts are limited to 5
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Posts, Post Types                    |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch good-first-bug           |     Focuses:
  reporter-feedback                              |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 I have reproduced the issue with these steps:
 1. Switch the theme to Twenty Twenty-One.
 2. Create 10 sticky posts.
 3. Create 10 non-sticky posts.
 4. On the home page, there are now 10 non-sticky posts and 5 sticky posts
 (instead of 10).

 It looks like this was introduced in [52982] / #36907 as a result of
 removing the `'nopaging' => true` argument from the `get_posts()` call in
 question. It's not quite clear why it was removed, as neither the ticket
 nor the commit message mention the removal. With `'nopaging' => true`
 restored, all 10 sticky posts are displayed as expected.

 This seems like a backward compatibility break, so I have reopened #36907
 with a patch.

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


More information about the wp-trac mailing list