[wp-trac] [WordPress Trac] #32342: Ampersand (&) in name breaks custom taxonomy

WordPress Trac noreply at wordpress.org
Mon May 11 13:34:08 UTC 2015


#32342: Ampersand (&) in name breaks custom taxonomy
-----------------------------+-----------------------------
 Reporter:  mediumdeviation  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Taxonomy         |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 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'
 ));
   }}}

 2. 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'.
 3. Try to add the taxonomy to a post, either using quick edit or by using
 the post edit admin page, then save the post.
 4. 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32342>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list