[wp-trac] Re: [WordPress Trac] #3985: _get_cat_children is very inefficient

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 5 04:00:21 GMT 2007


#3985: _get_cat_children is very inefficient
-------------------------------------------------------+--------------------
 Reporter:  ryan                                       |        Owner:       
     Type:  defect                                     |       Status:  new  
 Priority:  high                                       |    Milestone:  2.2  
Component:  Administration                             |      Version:  2.1.2
 Severity:  major                                      |   Resolution:       
 Keywords:  2nd-opnion category optimization hit-list  |  
-------------------------------------------------------+--------------------
Comment (by yskin):

 What about replace
 {{{
 delete_option('category_children');
 }}}
 in clean_category_cache() to
 {{{
 update_option('category_children', "");
 }}}

 clean_category_cache() will be called when publishing or editing posts.
 Category_children option will be deleted and added very often.

 An empty string can work well, because _get_category_hierarchy() use
 is_array() to check category_children option. If it is not an array, it
 will be identified as invalid cache.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3985#comment:16>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list