function hook_taxonomy_vocabulary_predelete

Act before taxonomy vocabulary deletion.

This hook is invoked before entity_bundle_delete() is called and before the vocabulary is actually removed.

Parameters

Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary: The taxonomy vocabulary entity that is about to be deleted.

See also

hook_taxonomy_vocabulary_delete()

Related topics

1 function implements hook_taxonomy_vocabulary_predelete()

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

File

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

Code

function hook_taxonomy_vocabulary_predelete(Drupal\taxonomy\Plugin\Core\Entity\Vocabulary $vocabulary) {
  db_delete('mytable_index')
    ->condition('vid', $vocabulary
    ->id())
    ->execute();
}