function hook_taxonomy_vocabulary_insert

7.x taxonomy.api.php hook_taxonomy_vocabulary_insert($vocabulary)

Act on taxonomy vocabularies when inserted.

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

Parameters

$vocabulary: A taxonomy vocabulary object.

Related topics

1 function implements hook_taxonomy_vocabulary_insert()

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_vocabulary_insert in drupal/modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_taxonomy_vocabulary_insert().
1 invocation of hook_taxonomy_vocabulary_insert()
taxonomy_vocabulary_save in drupal/modules/taxonomy/taxonomy.module
Saves a vocabulary.

File

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

Code

function hook_taxonomy_vocabulary_insert($vocabulary) {
  if ($vocabulary->synonyms) {
    variable_set('taxonomy_' . $vocabulary->vid . '_synonyms', TRUE);
  }
}