[wp-trac] [WordPress Trac] #21309: Introduce WP_Post class

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 22 17:59:22 UTC 2012


#21309: Introduce WP_Post class
----------------------------+------------------
 Reporter:  scribu          |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  3.5
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+------------------

Comment (by nacin):

 Replying to [comment:27 ryan]:
 > Before stickies-get_posts.diff:
 >
 > {{{
 > SELECT * FROM wp_trunk_posts WHERE wp_trunk_posts.ID IN (2131)
 > }}}
 >
 > After:
 >
 > {{{
 > SELECT wp_trunk_posts.* FROM wp_trunk_posts WHERE 1=1 AND
 wp_trunk_posts.ID IN (2131) AND wp_trunk_posts.post_type = 'post' AND
 (wp_trunk_posts.post_status = 'publish') ORDER BY wp_trunk_posts.post_date
 DESC
 > }}}
 >
 > Looks sane to me.

 Might break some situations where someone is using stick_post() on a non-
 post.

 That first query is faster, and could be replaced with
 _prime_post_caches(), though the order-by date is tempting.

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


More information about the wp-trac mailing list