Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#13609 closed defect (bug) (duplicate)

wp_insert_category doesn't seem to work correctly when adding sub-categories

Reported by: jrbriggs Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: General Keywords:
Focuses: Cc:


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).

Attachments (1)

Picture 1.png (101.1 KB) - added by jrbriggs 8 years ago.
screenshot of categories

Download all attachments as: .zip

Change History (4)

8 years ago

screenshot of categories

#1 @jrbriggs
8 years ago

  • Cc jrbriggs added

#2 @garyc40
7 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #14485

#3 @nacin
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.