function taxonomy_taxonomy_term_delete

Implements hook_taxonomy_term_delete().

Related topics

File

drupal/core/modules/taxonomy/taxonomy.module, line 1275
Enables the organization of content into categories.

Code

function taxonomy_taxonomy_term_delete(Term $term) {
  if (config('taxonomy.settings')
    ->get('maintain_index_table')) {

    // Clean up the {taxonomy_index} table when terms are deleted.
    db_delete('taxonomy_index')
      ->condition('tid', $term
      ->id())
      ->execute();
  }
}