[wp-trac] [WordPress Trac] #30780: Inconsistent behavior/results of wp_insert_term and wp_update_term

WordPress Trac noreply at wordpress.org
Fri Dec 19 22:29:42 UTC 2014


#30780: Inconsistent behavior/results of wp_insert_term and wp_update_term
-------------------------+------------------
 Reporter:  ipm-frommen  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.2
Component:  Taxonomy     |     Version:  4.1
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------

Comment (by boonebgorges):

 >  If there is no other term with this slug - even in other taxonomies -
 then there's no problem (i.e., renaming of the slug).

 Excellent - thanks for confirming.

 > My addition to the wp_unique_term_slug function makes sense to me in any
 case.

 It makes sense for the two places where `wp_unique_term_slug()` is
 currently used in core, but this function has existed in WP for many
 years, and is probably being used in various ways in plugins. This needs
 some analysis before we can go making substantive changes to its behavior.
 At a minimum, it needs more comprehensive unit test coverage.

 > The naming wp_unique_term_slug, however, does not fit anymore as it is
 sufficient to generate a slug that's unique in the given context

 I think this is a good observation, and it shows that changing the
 behavior of `wp_unique_term_slug()` is probably not a great idea, since
 it'll change the semantics of the function to some extent. It might be
 that the ideal solution will involve a new function with a new name, as I
 think that the stuff in that function related to parents no longer really
 makes any sense.

 I spent a few hours staring at this today and need to sleep on it to make
 any further conclusions :) I'll be back within the next few days with a
 patch. We'll definitely do something in 4.2.

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


More information about the wp-trac mailing list