[wp-trac] [WordPress Trac] #19384: register_taxonomy() doesn't fail (silently or otherwise) when trying to use a reserved term

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 28 19:26:46 UTC 2011


#19384: register_taxonomy() doesn't fail (silently or otherwise) when trying to use
a reserved term
--------------------------+-----------------------------
 Reporter:  iamfriendly   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  3.2.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Title says it all really, but here's how I found out:

 Registered a custom taxonomy called "type" and associated it with a custom
 post type called 'portfolio'. Worked fine, admin menu appeared, meta box
 was added to Portfolio CPT screens, everything worked as expected.

 Until... I tried to add an image, and then pressed the 'Media Library' tab
 in the overlay. Even though I had 72 images in my media library, it didn't
 show any at all. (Not a show-stopper, but pretty annoying). Tracked it
 down, eventually to the fact that 'type' is a reserved term.

 It looks like register_taxonomy() doesn't utilise taxonomy_exists(). I
 suspect this is because the latter function has only been around since 3.0
 whereas the former has been with us since 2.3.

 Suggestion: Throw an error if someone tries to overwrite a pre-existing
 taxonomy.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19384>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list