[wp-trac] [WordPress Trac] #53152: wp_set_object_terms ampersand in term name

WordPress Trac noreply at wordpress.org
Wed Mar 16 01:54:23 UTC 2022


#53152: wp_set_object_terms ampersand in term name
--------------------------------------+-----------------------------
 Reporter:  kapacity                  |       Owner:  (none)
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.0
Component:  Taxonomy                  |     Version:  5.7.1
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  administration
--------------------------------------+-----------------------------
Changes (by costdev):

 * keywords:  has-patch has-unit-tests dev-feedback => has-patch has-unit-
     tests
 * status:  new => closed
 * resolution:   => fixed


Comment:

 Good call @peterwilsoncc!

 Just tested on `trunk` using the same steps as before, which were:

 1. Run `wp_set_object_terms()` to set the category as `foo & bar`.
 2. Manually rename `foo & bar` to `this & that`, keep the slug as `foo-
 bar`.
 3. Run `wp_set_object_terms()` to set the category as `this & that`.

 Before [52921]:
 - Fails on 3: `A term with the name provided already exists with this
 parent.`. ❌

 After [52921]:
 - Succeeds on 3: The category is set to `this & that` (slug: `foo-bar`).
 ✅

 -----

 - Fixed in [52921].
 - Related ticket: #36949.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53152#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list