[wp-trac] [WordPress Trac] #29255: wp_insert_term() calls term_exists() with 'slug' where 'slug' gets compared to term 'name'

WordPress Trac noreply at wordpress.org
Thu Oct 23 13:42:14 UTC 2014


#29255: wp_insert_term() calls term_exists() with 'slug' where 'slug' gets compared
to term 'name'
---------------------------------------------+-----------------------------
 Reporter:  Rob Walker                       |       Owner:
     Type:  defect (bug)                     |      Status:  new
 Priority:  normal                           |   Milestone:  Awaiting
Component:  Taxonomy                         |  Review
 Severity:  normal                           |     Version:  3.9.2
 Keywords:  good-first-bug needs-unit-tests  |  Resolution:
                                             |     Focuses:
---------------------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:   => good-first-bug needs-unit-tests


Comment:

 Thanks for the report. This does sound like a bug, though I'm not sure how
 best to solve it. We can't stop checking against the 'name' column in
 `term_exists()` for backward compatibility reasons. I wonder if we might
 introduce another parameter that allows you to specify which columns
 you're checking against, and then in `wp_insert_term()`, if a 'slug' has
 been passed, we can tell `term_exists()` only to check the slug column.

 Whatever the solution, we'll need to have a unit test that demonstrates
 the problem.

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


More information about the wp-trac mailing list