function hook_taxonomy_term_presave
Act on taxonomy terms before they are saved.
Modules implementing this hook can act on the term object before it is inserted or updated.
Parameters
$term: A term object.
Related topics
2 functions implement hook_taxonomy_term_presave()
Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.
- EntityCrudHookTestHooks::taxonomyTermPresave in core/
modules/ system/ tests/ modules/ entity_crud_hook_test/ src/ Hook/ EntityCrudHookTestHooks.php - Implements hook_ENTITY_TYPE_presave() for taxonomy_term entities.
- entity_crud_hook_test_taxonomy_term_presave in modules/
simpletest/ tests/ entity_crud_hook_test.module - Implements hook_taxonomy_term_presave().
1 invocation of hook_taxonomy_term_presave()
- taxonomy_term_save in modules/
taxonomy/ taxonomy.module - Saves a term object to the database.
File
-
modules/
taxonomy/ taxonomy.api.php, line 125
Code
function hook_taxonomy_term_presave($term) {
$term->foo = 'bar';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.