[wp-trac] [WordPress Trac] #9300: WP_Query with showposts and sticky posts

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 10 15:24:04 UTC 2009


#9300: WP_Query with showposts and sticky posts
--------------------------+-------------------------------------------------
 Reporter:  yukataninja   |        Owner:  anonymous     
     Type:  defect (bug)  |       Status:  reopened      
 Priority:  low           |    Milestone:  Future Release
Component:  Query         |      Version:                
 Severity:  minor         |   Resolution:                
 Keywords:  needs-patch   |  
--------------------------+-------------------------------------------------
Changes (by Denis-de-Bernardy):

  * priority:  normal => low
  * component:  General => Query
  * severity:  normal => minor
  * milestone:  => Future Release


Comment:

 You are completely correct in that it is not intuitive. But there's no
 easy workaround without re-engineering of the WP_Query class.

 Intuitively, we'd need to look-up sticky posts first, and then change the
 query's LIMIT statement accordingly. Doing so, however, introduces a new
 issue, which is what happens when a sticky post should be returned as part
 of the result anyway. Quite arguably, we could end up stripping stickies
 from all non-singular queries where they might appear, but the performance
 impact is not benign.

 The least problematic ends up being the current setup, with you using the
 caller_get_posts argument.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9300#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list