function hook_taxonomy_vocabulary_insert

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

File

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

Code

function hook_taxonomy_vocabulary_insert($vocabulary) {
  if ($vocabulary->machine_name == 'my_vocabulary') {
    $vocabulary->weight = 100;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!taxonomy!taxonomy.api.php/function/hook_taxonomy_vocabulary_insert/7.x