Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#11825 closed defect (bug) (fixed)

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

Reported by: thetoine's profile thetoine Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.1
Component: General Keywords: taxonomy
Focuses: 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 15 years ago.

Download all attachments as: .zip

Change History (4)

#1 @ryan
15 years ago

  • Milestone changed from Unassigned to 3.0

#2 @automattor
15 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
15 years ago

Awesome, quick fix!

Note: See TracTickets for help on using tickets.