Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 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: Focuses:

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

Download all attachments as: .zip

Change History (4)

#1 @ryan
17 years ago

  • Milestone Unassigned → 3.0

#2 @automattor
17 years ago

  • Resolution → fixed
  • Status new → closed

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

#3 @thetoine
17 years ago

Awesome, quick fix!

Note: See TracTickets for help on using tickets.