[wp-trac] [WordPress Trac] #10277: How to get root category

WordPress Trac wp-trac at lists.automattic.com
Sat Dec 26 15:42:51 UTC 2009


#10277: How to get root category
-------------------------+--------------------------------------------------
 Reporter:  bi0xid       |       Owner:  filosofo      
     Type:  enhancement  |      Status:  new           
 Priority:  normal       |   Milestone:  Future Release
Component:  Taxonomy     |     Version:  2.9           
 Severity:  normal       |    Keywords:  root category 
-------------------------+--------------------------------------------------

Comment(by hakre):

 Replying to [comment:7 bi0xid]:
 > I have used filosofo's implementation in .diff. I think it prevents
 endless recursion and database problems. What do you think?

 It will create and endless loop given the following data:

 {{{
 Cat1->parent = Cat2
 Cat2->parent = Cat3
 Cat3->parent = Cat1
 }}}

 calling {{{get_category_root($cat_id = }}}''id of Cat1''{{{)}}} will
 create an endless loop.

 Maybe that gives you an idea. What I like is that it resolves linear so
 far.

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


More information about the wp-trac mailing list