function hook_taxonomy_vocabulary_delete

Respond to taxonomy vocabulary deletion.

This hook is invoked from taxonomy_vocabulary_delete() after field_attach_delete_bundle() has been called and after the vocabulary has been removed from the database.

Parameters

Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary: The taxonomy vocabulary entity that has been deleted.

See also

hook_taxonomy_vocabulary_predelete()

taxonomy_vocabulary_delete()

Related topics

1 function implements hook_taxonomy_vocabulary_delete()

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

File

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

Code

function hook_taxonomy_vocabulary_delete(Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary) {
  if (variable_get('taxonomy_' . $vocabulary->vid . '_synonyms', FALSE)) {
    variable_del('taxonomy_' . $vocabulary->vid . '_synonyms');
  }
}