1 taxonomy.api.php hook_taxonomy_vocabulary_predelete(TaxonomyVocabulary $vocabulary)

Act before taxonomy vocabulary deletion.

This hook is invoked from taxonomy_vocabulary_delete() before field_attach_delete_bundle() is called and before the vocabulary is actually removed from the database.

Parameters

TaxonomyVocabulary $vocabulary: The taxonomy vocabulary that is about to be deleted.

See also

hook_taxonomy_vocabulary_delete()

taxonomy_vocabulary_delete()

Related topics

File

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

Code

function hook_taxonomy_vocabulary_predelete(TaxonomyVocabulary $vocabulary) {
  db_delete('mytable')
    ->condition('vocabulary', $vocabulary->machine_name)
    ->execute();
}