function hook_taxonomy_term_delete

Respond to taxonomy term deletion.

This hook is invoked from taxonomy_term_delete() 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.

See also

taxonomy_term_delete()

Related topics

1 call to hook_taxonomy_term_delete()
hook_taxonomy_term_update in drupal/core/modules/taxonomy/taxonomy.api.php
Act on taxonomy terms when updated.
5 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().
taxonomy_test_taxonomy_term_delete in drupal/core/modules/system/tests/modules/taxonomy_test/taxonomy_test.module
Implements hook_taxonomy_term_delete().

File

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

Code

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