[wp-trac] [WordPress Trac] #5809: Updating a term in one taxonomy affects the term in every taxonomy

WordPress Trac noreply at wordpress.org
Wed Feb 11 19:41:57 UTC 2015


#5809: Updating a term in one taxonomy affects the term in every taxonomy
--------------------------+---------------------------
 Reporter:  rmccue        |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  4.2
Component:  Taxonomy      |     Version:  2.3
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------------

Comment (by boonebgorges):

 In [changeset:"31418"]:
 {{{
 #!CommitTicketReference repository="" revision="31418"
 Split shared taxonomy terms on term update.

 When updating an existing taxonomy term that shares its `term_id` with
 another term, we generate a new row in `wp_terms` and associate the
 updated
 term_taxonomy_id with the new term. This separates the terms, such that
 updating the name of one term does not change the name of any others.

 In cases where a plugin or theme stores term IDs in the database, term
 splitting
 can cause backward compatibility issues. The current changeset introduces
 two utilities to aid developers with the transition. The
 `'split_shared_term'`
 action fires when the split takes place, and should be used to catch
 changes in
 term_id. In cases where `'split_shared_term'` cannot be used, the
 `wp_get_split_term()` function gives developers access to data about terms
 that have previously been split. Documentation for these functions, with
 examples, can be found in the Plugin Developer Handbook. WordPress itself
 stores term IDs in this way in two places;
 `_wp_check_split_default_terms()`
 and `_wp_check_split_terms_in_menus()` are hooked to `'split_shared_term'`
 to
 perform the necessary cleanup.

 See [30241] for a previous attempt at the split. It was reverted in
 [30585]
 for 4.1.0.

 Props boonebgorges, mboynes.
 See #5809.
 }}}

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


More information about the wp-trac mailing list