You are here

function taxonomy_menu_items_rebuild in Taxonomy menu 8

Rebuilds all the menu items.

Parameters

$vid: The vocabulary ID of the taxonomy terms from which to rebuild the menu links.

1 call to taxonomy_menu_items_rebuild()
taxonomy_menu_vocab_submit in ./taxonomy_menu.admin.inc
Form submission handler for taxonomy_form_vocabulary().

File

./taxonomy_menu.module, line 44
Generates menu links for all selected taxonomy terms.

Code

function taxonomy_menu_items_rebuild($vid) {

  // Get the name of the menu from the administration settings.
  $menu_exists = taxonomy_menu_variable_get('vocab_menu', $vid, FALSE);

  // Delete the menu links associated to this vocabulary.
  taxonomy_menu_menu_links_delete($vid);

  // Re-create the menu links if a menu is set.
  if ($menu_exists) {
    taxonomy_menu_menu_links_insert($vid);
  }
}