WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 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:

Description

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 4 years ago.
screenshot of categories

Download all attachments as: .zip

Change History (4)

jrbriggs4 years ago

screenshot of categories

comment:1 jrbriggs4 years ago

  • Cc jrbriggs added

comment:2 garyc403 years ago

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

duplicate of #14485

comment:3 nacin3 years ago

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