[wp-trac] [WordPress Trac] #39984: wp_insert_term can return wrong ID when multiple existing terms are found with the same name but differnet parent
WordPress Trac
noreply at wordpress.org
Fri Mar 3 02:31:31 UTC 2017
#39984: wp_insert_term can return wrong ID when multiple existing terms are found
with the same name but differnet parent
-------------------------------------------------+-------------------------
Reporter: mikejolley | Owner:
Type: defect (bug) | boonebgorges
Priority: normal | Status: accepted
Component: Taxonomy | Milestone: 4.8
Severity: normal | Version: 4.2
Keywords: has-patch dev-feedback needs- | Resolution:
testing | Focuses:
-------------------------------------------------+-------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => accepted
* version: trunk => 4.2
Comment:
Thanks, @mikejolley.
> I think it's important we allow multiple terms with same names under
different parents.
Yes, WP has always allowed this. This particular weird bug was introduced
as part of a refactor in support of multibyte slugs. See
https://core.trac.wordpress.org/ticket/31328#comment:9 and follow-up
conversation, especially [31792]. (Prior to WP 4.2, this specific kind of
bug didn't occur because we used `term_exists()` instead of `get_term_by(
'name' )`; `term_exists()` would fall back on a slug check.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39984#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list