function hook_taxonomy_term_delete

Respond to the deletion of taxonomy terms.

Modules implementing this hook can respond to the deletion of taxonomy terms from the database.

Parameters

$term: A taxonomy term object.

Related topics

8 functions implement hook_taxonomy_term_delete()

Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.

EntityCrudHookTestHooks::taxonomyTermDelete in core/modules/system/tests/modules/entity_crud_hook_test/src/Hook/EntityCrudHookTestHooks.php
Implements hook_ENTITY_TYPE_delete() for taxonomy_term entities.
entity_crud_hook_test_taxonomy_term_delete in modules/simpletest/tests/entity_crud_hook_test.module
Implements hook_taxonomy_term_delete().
forum_taxonomy_term_delete in modules/forum/forum.module
Implements hook_taxonomy_term_delete().
path_taxonomy_term_delete in modules/path/path.module
Implements hook_taxonomy_term_delete().
TaxonomyHooks::taxonomyTermDelete in core/modules/taxonomy/src/Hook/TaxonomyHooks.php
Implements hook_ENTITY_TYPE_delete() for taxonomy_term entities.

... See full list

1 invocation of hook_taxonomy_term_delete()
taxonomy_term_delete in modules/taxonomy/taxonomy.module
Delete a term.

File

modules/taxonomy/taxonomy.api.php, line 171

Code

function hook_taxonomy_term_delete($term) {
    db_delete('mytable')->condition('tid', $term->tid)
        ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.