Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#11825 closed defect (bug) (fixed)

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

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



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 6 years ago.

Download all attachments as: .zip

Change History (4)

#1 @ryan
6 years ago

  • Milestone changed from Unassigned to 3.0

#2 @automattor
6 years ago

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

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

#3 @thetoine
6 years ago

Awesome, quick fix!

Note: See TracTickets for help on using tickets.