[wp-trac] [WordPress Trac] #13609: wp_insert_category doesn't seem to work correctly when adding sub-categories

WordPress Trac wp-trac at lists.automattic.com
Fri May 28 21:54:57 UTC 2010


#13609: wp_insert_category doesn't seem to work correctly when adding sub-
categories
--------------------------+-------------------------------------------------
 Reporter:  jrbriggs      |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  3.0       
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 I have some code which creates a category and then a child category:

     $cat_id = wp_insert_category(array('cat_name'=>'products',
 'category_description'=>'root category'));
     wp_insert_category(array('cat_name'=>'default',
 'category_nicename'=>'default', 'category_description'=>'default
 category', 'category_parent'=>$cat_id));

 This worked fine in 2.9.2, but in 3, the child category doesn't appear in
 the list on the Categories screen (however it does appear in the Parent
 drop down, and in the list of available categories when I edit a post).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13609>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list