wordpress-develop/tests/phpunit/tests/term
Boone Gorges ed639b408a 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@31418 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 19:41:54 +00:00
..
cache.php Update individual term caches in get_terms(). 2014-12-17 16:38:44 +00:00
categoryExists.php Default $parent in category_exists() should default to null rather than 0. 2015-01-11 01:25:19 +00:00
getTerms.php Ensure that 'hierarchical' is respected in get_terms() when multiple taxonomies are passed. 2015-01-26 19:03:09 +00:00
isObjectInTerm.php In in_object_in_term(), only check numeric string values against term_id. 2014-11-03 14:24:23 +00:00
query.php Improve WP_Tax_Query param sanitization for empty strings. 2014-10-26 22:56:36 +00:00
slashes.php Move PHPUnit tests into a tests/phpunit directory. 2013-08-29 18:39:34 +00:00
splitSharedTerm.php Split shared taxonomy terms on term update. 2015-02-11 19:41:54 +00:00
termExists.php Move term_exists() tests to their own file. 2014-10-30 18:52:37 +00:00
wpDeleteObjectTermRelationships.php Add tests for wp_delete_object_term_relationships(). 2015-01-02 14:02:54 +00:00
wpGetObjectTerms.php Introduce 'parent' parameter to wp_get_object_terms(). 2015-01-23 14:56:04 +00:00