[wp-trac] [WordPress Trac] #16253: Object term cache not working for taxonomy query page - resulting 200 queries for 10 posts

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 16 16:42:21 UTC 2011


#16253: Object term cache not working for taxonomy query page - resulting 200
queries for 10 posts
--------------------------+------------------------------
 Reporter:  badskills     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cache         |     Version:  3.0.4
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by scribu):

 I can't seem to reproduce.

 Here is the code I'm using, on a clean install of Twentyten:

 {{{
 <?php

 add_action('init', function() {
         register_taxonomy('color', 'post', array('label' => 'Color'));
 });

 add_action('the_post', function( $post ) {
         print_r( get_object_term_cache( $post->ID, 'color' ) );
         echo the_terms( $post->ID, 'color' );
 });
 }}}

 When going to {{{?color=green}}}, the cache is pre-filled by WP_Query.

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


More information about the wp-trac mailing list