function taxonomy_menu_menu_links_update in Taxonomy menu 7.2
Same name and namespace in other branches
- 8 taxonomy_menu.module \taxonomy_menu_menu_links_update()
Updates menu links associated to a vocabulary.
Parameters
$vid: The ID of the vocabulary.
2 calls to taxonomy_menu_menu_links_update()
- taxonomy_menu_overview_terms_submit in ./
taxonomy_menu.admin.inc - Additional submit handler for terms overview form.
- taxonomy_menu_vocab_submit in ./
taxonomy_menu.admin.inc - Form submission handler for taxonomy_form_vocabulary().
File
- ./
taxonomy_menu.module, line 89 - Generates menu links for all selected taxonomy terms.
Code
function taxonomy_menu_menu_links_update($vid) {
// Get a list of all the existing taxonomy terms for that vocabulary and
// process them using the bacth API.
$menu_name = taxonomy_menu_variable_get('vocab_menu', $vid, FALSE);
$tm_menu_links = _taxonomy_menu_get_menu_items($vid);
$term_ids = array_values($tm_menu_links);
$terms = taxonomy_term_load_multiple($term_ids);
_taxonomy_menu_save_menu_links_batch($terms, $menu_name);
menu_cache_clear($menu_name);
drupal_set_message(t('The Taxonomy menu has been updated.'), 'status');
}