function hook_taxonomy_term_delete

Respond to taxonomy term deletion.

This hook is invoked from taxonomy term deletion after field_attach_delete() has been called and after the term has been removed from the database.

Parameters

Drupal\taxonomy\Term $term: The taxonomy term entity that has been deleted.

Related topics

4 functions implement hook_taxonomy_term_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_term_delete in drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.module
Implements hook_taxonomy_term_delete().
forum_taxonomy_term_delete in drupal/core/modules/forum/forum.module
Implements hook_taxonomy_term_delete().
path_taxonomy_term_delete in drupal/core/modules/path/path.module
Implements hook_taxonomy_term_delete().
taxonomy_taxonomy_term_delete in drupal/core/modules/taxonomy/taxonomy.module
Implements hook_taxonomy_term_delete().

File

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

Code

function hook_taxonomy_term_delete(Drupal\taxonomy\Term $term) {
  db_delete('mytable')
    ->condition('tid', $term
    ->id())
    ->execute();
}