[wp-trac] Re: [WordPress Trac] #9661: cat_row doesn't not list all
	categories
    WordPress Trac 
    wp-trac at lists.automattic.com
       
    Tue Apr 28 14:32:49 GMT 2009
    
    
  
#9661: cat_row  doesn't not list all categories
--------------------------------------------------+-------------------------
 Reporter:  hailin                                |        Owner:  anonymous
     Type:  defect (bug)                          |       Status:  reopened 
 Priority:  normal                                |    Milestone:  2.8      
Component:  General                               |      Version:           
 Severity:  normal                                |   Resolution:           
 Keywords:  developer-feedback reporter-feedback  |  
--------------------------------------------------+-------------------------
Comment(by hailin):
 patch is for WP trunk revision 11073 (those functions were there since
 June 2008).
 The subtree handling had an issue because $my_parent in the following
 block was not initialized, thus while statement won't execute at all.  In
 the patch, I also used $p to refer to the parent term_id, to distinguish
 it from category object itself so that it's a little bit more readable.
 $my_parents = array();
 while ( $my_parent) {
         $my_parent = get_category($my_parent);
         $my_parents[] = $my_parent;
         if ( !$my_parent->parent )
                 break;
         $my_parent = $my_parent->parent;
 }
 hakre: thanks for the array foreach notes, I learned something too.
-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9661#comment:18>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
    
    
More information about the wp-trac
mailing list