[wp-trac] [WordPress Trac] #27282: WP_Query returns more results when there are sticky posts

WordPress Trac noreply at wordpress.org
Fri Feb 13 14:46:26 UTC 2015


#27282: WP_Query returns more results when there are sticky posts
--------------------------+-----------------------------
 Reporter:  markoheijnen  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Query         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by bendoh):

 * keywords:  needs-patch => has-patch


Comment:

 Heya! Thanks for writing back. I was hoping this ticket wasn't completely
 dead.

 I went ahead and ran the unit tests and did find those failures. I went
 ahead and fixed them and all the tests pass now. I also added one other
 test, test_stickies_more_than_posts_per_page_second_page in
 attachment:27282-tests-1.diff which demonstrates the behavior for when the
 number of stickies is greater than posts_per_page, which with this patch,
 causes them to spill over onto the second page. I personally think this is
 correct behavior, but I agree that this topic definitely needs a bit more
 discussion as blindly implementing it could break some (very few?) sites.
 I'm not too familiar with what existing BB / Forum software does for this
 situation, so I would have to spend a bit of time investigating to get a
 feel for it.

 See attachment:27282-tests-1.diff (am I doing this wrong, how do I drop
 the 'attachment:' prefix?) for the extended patch with your tests as well
 as the new test, and attachment:27282-passes-tests.diff for the updated
 patch against the wp-test repo @31448.

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


More information about the wp-trac mailing list