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

WordPress Trac noreply at wordpress.org
Fri Dec 19 13:39:06 UTC 2014


#30780: Inconsistent behavior/results of wp_inesrt_term and wp_update_term
--------------------------+-----------------------------
 Reporter:  ipm-frommen   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In WordPress 4.1, I noticed the following behavior (in my opinion
 misbehavior):

 * I can create a new '''category''' ''Ping'' (slug `ping`);
 * I can create a new '''tag''' ''Ping'' (slug `ping`).

 This means, I have two terms (one DB entry each) that have the same slug,
 each in one of the two mentioned taxonomies.

 With the above ''setup'', I continue like so:

 * I can change the slug of the '''category''' ''Ping'' to `pong`;
 * I can '''not''' change the slug back to `ping` (''The slug "ping" is
 already in use by another term'').

 This is true for both QuickEdit and Edit.

 I hope this is not ''by-design''!?

 In function `wp_insert_post`, there is a check for the existence of the
 new slug - in the very taxonomy. In function `wp_update_term`, however,
 there is a check for the slug only (no taxonomy included in the
 query/check).

 Please see attached path. It just uses the check from `wp_insert_term` in
 `wp_update_term`.

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


More information about the wp-trac mailing list