1 taxonomy.api.php hook_taxonomy_term_presave(TaxonomyTerm $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.

Parameters

TaxonomyTerm $term: A taxonomy term entity.

Related topics

File

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

Code

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