function hook_taxonomy_vocabulary_update

Act on taxonomy vocabularies when updated.

Modules implementing this hook can act on the vocabulary object when updated.

Parameters

Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary: A taxonomy vocabulary entity.

Related topics

2 functions implement hook_taxonomy_vocabulary_update()

File

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

Code

function hook_taxonomy_vocabulary_update(Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary) {
  $status = $vocabulary->synonyms ? TRUE : FALSE;
  if ($vocabulary->synonyms) {
    variable_set('taxonomy_' . $vocabulary->vid . '_synonyms', $status);
  }
}