[wp-trac] [WordPress Trac] #21986: Roll sticky posts into MySQL query

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 24 19:10:09 UTC 2012


#21986: Roll sticky posts into MySQL query
-----------------------------+-------------------------
 Reporter:  martinshopland   |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Query
  Version:  3.4.2            |   Severity:  normal
 Keywords:  has-patch        |
-----------------------------+-------------------------
 The way that WP currently queries for sticky posts is quite long winded
 and prone to error. Sticky posts output behaviour is erratic when using
 pagination or ordering. I suggest that the sticky posts feature would be
 better served by being rolled into the MySQL query rather than trying to
 reconstruct the result set after the main query has run.

 I have tested the attached patch against 3.4.2 and it works as expected.
 The query additions are performed on every page of home, rather than just
 the first, so that page boundaries behave as expected and that the sticky
 posts don't appear on subsequent pages. ignore-sticky-posts is honoured.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21986>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list