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

WordPress Trac noreply at wordpress.org
Mon Dec 22 07:50:14 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.1.1
Component:  Taxonomy               |     Version:  4.1
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+--------------------

Comment (by ipm-frommen):

 Hi Boone,

 I just tried your new patch, and it seems to work. Thanks for that.

 What I still don't really like is the following:

 '''Szenario A'''
 - there is a top-level term with the slug `foo`
 - you add a new term ''Foo'', which you also would like to have the slug
 `foo`, to an already existing term ''Bar''
 - the new term gets the slug `foo-bar` instead

 '''Szenario A'''
 - there is a '''child''' term with the slug `foo` (i.e., this term has a
 parent)
 - you add a new top-level term ''Foo'', which you also would like to have
 the slug `foo`
 - the new term gets the slug `foo-2` instead

 And here's the thing: in both cases, you can edit the new term and
 manually make it have the slug `foo`.

 The reason for the automatically (and unnecessary) given suffixed slug
 lies within `wp_unique_term_slug` function. Okay, we already (sliently)
 agreed in that it might be best not to change this function. But then we
 should take care of it not being used when it's not necessary. This means
 we either create a new function that takes care of checking (and maybe
 adapting) the new slug, or we have to check some cases and according to
 these don't use `wp_unique_term_slug` - just because it's not necessary.

 I hope this makes sense.

 Cheers,
 Thorsten

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


More information about the wp-trac mailing list