[wp-trac] [WordPress Trac] #28159: get_body_class makes a raw, uncacheable query for child posts

WordPress Trac noreply at wordpress.org
Tue Jun 3 13:49:09 UTC 2014


#28159: get_body_class makes a raw, uncacheable query for child posts
--------------------------+-----------------------
 Reporter:  rmccue        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.0
Component:  Themes        |     Version:  2.8
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  template
--------------------------+-----------------------

Comment (by nacin):

 This would work, and would leverage post caches:
 {{{
 $parent_page = get_post( $page_id );
 if ( 'page' === $parent_page->post_type && 'publish' ===
 $parent_page->post_status ) {

 }
 }}}

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


More information about the wp-trac mailing list