7.x taxonomy.api.php hook_taxonomy_term_presave($term)

Act on taxonomy terms before they are saved.

Modules implementing this hook can act on the term object before it is inserted or updated.


$term: A term object.

Related topics

1 function implements hook_taxonomy_term_presave()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

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.


modules/taxonomy/taxonomy.api.php, line 125
Hooks provided by the Taxonomy module.


function hook_taxonomy_term_presave($term) {
  $term->foo = 'bar';


dankh’s picture

If you want to compare modified term data you can access the original term in $term->original . The original term data is injected by taxonomy_term_save() before module_invoke_all is called.