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

WordPress Trac noreply at wordpress.org
Wed Jan 28 19:49:30 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:
--------------------------+---------------------------
Changes (by boonebgorges):

 * keywords:  has-patch 4.2-early => has-patch


Comment:

 [attachment:5809.6.patch] refreshes the patch for trunk. The term
 splitting logic is as before: on `wp_update_term()`, if the term being
 updated is shared with another term, assign the updated term with a new
 ID.

 Plugins that store term_ids may experience miscellaneous breakage when
 term_ids change; see #30335. There are two mechanisms in the patch to ease
 the transition. (1) Hooking to the `'split_shared_term'` action will allow
 plugins to make the necessary adjustments at the time of splitting. This
 action was in previous versions of the patch. (2) A new addition to this
 patch is `wp_get_split_terms( $term_id, $taxonomy = '' )`. We will store
 information about previously split terms in an options array, and this new
 function provides controlled access to the array. In this way, any plugin
 that needs to go back and see which terms have been split (given the old
 term_id) can use this function to do necessary cleanup.

 mboynes and I have prepared some documentation for this change. The draft
 can be found at https://gist.github.com/boonebgorges/e873fc9589998f5b07e1.
 It's written to be a brief and practical how-to, appropriate for a Codex
 article. I'm imagining that it should be accompanied by a make/core post
 that provides some more historical context.

 We're looking for feedback on the following:
 - `wp_get_split_terms()` - Does this seem like the right way to expose
 saved data about split terms?
 - Is the documentation clear enough? We tried to give representative
 examples that any developer could follow; we did not try to be exhaustive
 in our explanations.

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


More information about the wp-trac mailing list