You are here

function taxonomy_menu_taxonomy_vocabulary_delete in Taxonomy menu 7

Same name and namespace in other branches
  1. 8 taxonomy_menu.module \taxonomy_menu_taxonomy_vocabulary_delete()
  2. 7.2 taxonomy_menu.module \taxonomy_menu_taxonomy_vocabulary_delete()

Implements hook_taxonomy_vocabulary_delete().

File

./taxonomy_menu.module, line 362
Adds links to taxonomy terms into a menu.

Code

function taxonomy_menu_taxonomy_vocabulary_delete($vocabulary) {

  // Delete the menu items for this vocab.
  _taxonomy_menu_delete_all($vocabulary->vid);
  $menu_name = variable_get(_taxonomy_menu_build_variable('vocab_menu', $vocabulary->vid), 0);
  menu_cache_clear($menu_name);

  // Delete all the variables for this vocab.
  $variable_prefixes = array(
    'taxonomy_menu_vocab_menu_',
    'taxonomy_menu_vocab_parent_',
    'taxonomy_menu_voc_item_',
    'taxonomy_menu_display_num_',
    'taxonomy_menu_hide_empty_terms_',
    'taxonomy_menu_expanded_',
    'taxonomy_menu_rebuild_',
    'taxonomy_menu_path_',
    'taxonomy_menu_menu_end_all_',
    'taxonomy_menu_display_descendants_',
    'taxonomy_menu_voc_name_',
    'taxonomy_menu_sync_',
  );
  foreach ($variable_prefixes as $prefix) {
    variable_del($prefix . $vocabulary->name);
  }
}