Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#11825 closed defect (bug) (fixed)

wp_create_category() in Taxonomy Administration API ignoring the "parent" ID param

Reported by: thetoine Owned by:
Priority: normal Milestone: 3.0
Component: General Version: 2.9.1
Severity: normal Keywords: taxonomy
Cc:

Description

http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/taxonomy.php#L51

Function is checking if the category exist, but without sending the "parent" categoryID parameter :

if ( $id = category_exists($cat_name) )

Should be :

if ( $id = category_exists($cat_name, $parent) )

The code works fine unless 2 sub-categories shares the same name.

Attachments (1)

taxonomy-patch.diff (105 bytes) - added by thetoine 3 years ago.

Download all attachments as: .zip

Change History (4)

comment:1   ryan3 years ago

  • Milestone changed from Unassigned to 3.0
  • Resolution set to fixed
  • Status changed from new to closed

(In [12662]) Pass parent to category_exists(). Props thetoine. fixes #11825

Awesome, quick fix!

Note: See TracTickets for help on using tickets.