[wp-trac] Re: [WordPress Trac] #9007: Poor get_category_children() performance; rewrite to use get_term_children()

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 31 16:54:51 GMT 2009


#9007: Poor get_category_children() performance; rewrite to use
get_term_children()
---------------------------------------------+------------------------------
 Reporter:  _timk                            |        Owner:  ryan
     Type:  defect (bug)                     |       Status:  new 
 Priority:  normal                           |    Milestone:  2.8 
Component:  Taxonomy                         |      Version:  2.7 
 Severity:  normal                           |   Resolution:      
 Keywords:  has-patch get_category_children  |  
---------------------------------------------+------------------------------
Changes (by filosofo):

  * keywords:  => has-patch get_category_children

Comment:

 _timk, thanks for bringing this old function to light, but there are some
 odd things here.
  * You say that your problems stemmed from {{{get_categories}}}'s calling
 {{{get_category_children}}}, but {{{get_categories}}} has ''never'' used
 {{{get_category_children}}}.  Up to version 2.3 of !WordPress,
 {{{get_categories}}} did use the private function {{{_get_cat_children}}},
 but that was dropped in 2.3 with the implementation of the new taxonomy
 system.
  * Since !WordPress 2.3 ''no'' core functions have called
 {{{get_category_children}}}.  It's basically a vestige from the 2.2 and
 earlier days when it was used to build category queries.
  * {{{get_category_children}}}, having been used originally in core to
 build category queries, would have been better off as a private function,
 IMO.
  * {{{get_category_children}}} is not used in core, and my grep of the
 plugins repository turns up its use in only 5 plugins.  Of those plugins,
 3 seem to have been abandoned, as they're using the old 2.2 category
 tables.  The other 2 say "tested up to 2.5.1"
  * So I think we should deprecate {{{get_category_children}}}.  My patch
 does that.
  * _timk, if you're having performance issues in !WordPress 2.7 or trunk,
 it's probably due to something else---let's try to figure out what that
 is.

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


More information about the wp-trac mailing list