function hook_taxonomy_vocabulary_create

Act on a newly created vocabulary.

This hook runs after a new vocabulary object has just been instantiated. It can be used to set initial values, e.g. to provide defaults.

Parameters

\Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary: The vocabulary object.

Related topics

1 function implements hook_taxonomy_vocabulary_create()

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_create in drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.module
Implements hook_taxonomy_vocabulary_create().

File

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

Code

function hook_taxonomy_vocabulary_create(\Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary) {
  if (!isset($vocabulary->foo)) {
    $vocabulary->foo = NULL;
  }
}