[wp-trac] [WordPress Trac] #14485: Didn't show up children category when created parent and children categories at the same time.

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 12 11:19:32 UTC 2010


#14485: Didn't show up children category when created parent and children
categories at the same time.
--------------------------+-------------------------------------------------
 Reporter:  thealien      |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  high          |   Milestone:  3.1                    
Component:  Cache         |     Version:  3.0                    
 Severity:  normal        |    Keywords:  has-patch needs-testing
--------------------------+-------------------------------------------------

Comment(by garyc40):

 > In clean_term_cache(), you should check $clean_taxonomy before going
 through all the $cache_keys, no?

 Right, that makes sense. I'll revise the patch again. The original code
 changes $last_changed regardless of $clean_taxonomy though, so I've been
 wondering if there's any particular reason why it skips checking
 $clean_taxonomy.

 One thing to note though. With both my patch and the original code, if you
 clean_term_cache( $term, $taxonomy, true ), all get_terms cache of all
 taxonomies will be outdated anyways (instead of only $taxonomy's get_terms
 cache). So there's still that flaw of over-invalidating. However,
 get_terms can accept a list of taxonomies, and allocating get_terms cache
 for each taxonomy is just too cumbersome if not impossible.

 > Also, instead of:
 >
 > {{{
 > $force_clean_taxonomy = ( $parent ) ? true : false;
 > clean_term_cache($term_id, $taxonomy, true, $force_clean_taxonomy);
 > }}}
 >
 > it's better to do:
 >
 > {{{
 > clean_term_cache($term_id, $taxonomy, true, (bool) $parent);
 > }}}

 Sure, good suggestion.

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


More information about the wp-trac mailing list