Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#32342 closed defect (bug) (duplicate)

Ampersand (&) in name breaks custom taxonomy

Reported by: mediumdeviation's profile mediumdeviation Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Taxonomy Keywords:
Focuses: Cc:


Steps to reproduce:

  1. Create custom taxonomy, for posts - this bug doesn't reproduce with tags. This is the code I was using in my functions.php.
register_taxonomy('series', 'post', array(
	'label' => 'Article Series'
  1. Create a custom taxonomy with an ampersand in the name. Not all cases reproduce - the smallest case where I find it works is 'AB&' or 'A B & C D'.
  2. Try to add the taxonomy to a post, either using quick edit or by using the post edit admin page, then save the post.
  3. The taxonomy edit fails silently. Any other changes made, like removing an existing taxonomy, will also not register.

It's not a permissions issue - I'm doing this as an administrator. I've traced the bug to get_terms - running get_terms('series', array('name' => 'AB&' )); gives me an empty array, at which point it got too frustrating (I traced the bug all the way from edit_post). The taxonomy still shows up in the taxonomy's admin page table, and you can still access it in the permalink location.

Change History (1)

#1 @boonebgorges
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

mediumdeviation - Thanks very much for the detailed report. It appears that this is a duplicate of #32248, which has been fixed in trunk. Please verify the fix there, and feel free to reopen if you find that it's not in fact the same issue.

Note: See TracTickets for help on using tickets.