1 taxonomy.api.php hook_taxonomy_term_insert(TaxonomyTerm $term)

Act on taxonomy terms when inserted.

Modules implementing this hook can act on the term object when saved to the database.

Parameters

TaxonomyTerm $term: A taxonomy term entity.

Related topics

File

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

Code

function hook_taxonomy_term_insert(TaxonomyTerm $term) {
  db_insert('mytable')
    ->fields(array(
      'tid' => $term->tid,
      'foo' => $term->foo,
    ))
    ->execute();
}