[wp-trac] [WordPress Trac] #43271: Issue with term duplicate check in wp_insert_term

WordPress Trac noreply at wordpress.org
Mon Aug 13 15:51:31 UTC 2018


#43271: Issue with term duplicate check in wp_insert_term
-----------------------------------------+------------------------------
 Reporter:  strategio                    |       Owner:  (none)
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Taxonomy                     |     Version:  4.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+------------------------------

Comment (by boonebgorges):

 Thanks for reviewing and confirming, @strategio.

 > I would just ask to replace the parameter $term with $slug in the
 filter. Indeed, we search duplicates with the same parent + taxonomy +
 slug (but the term name can still be duplicated).

 `$duplicate_term` should contain all the information you need: `slug`,
 `taxonomy`, `name`, etc. I've chosen to pass `$term`, `$taxonomy`, and
 `$args` to the filter as well, because these are the original values that
 were passed to `wp_insert_term()`, and they may differ from those used in
 the `$duplicate_term` check. Can you confirm this reasoning?

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


More information about the wp-trac mailing list