function _taxonomy_menu_delete_all in Taxonomy menu 7
Same name and namespace in other branches
- 8 taxonomy_menu.database.inc \_taxonomy_menu_delete_all()
- 6.2 taxonomy_menu.database.inc \_taxonomy_menu_delete_all()
- 7.2 taxonomy_menu.database.inc \_taxonomy_menu_delete_all()
Deletes all links associated with this vocab from both the taxonomy_menu table and the menu_link table.
Parameters
int $vid: Vocabulary ID.
2 calls to _taxonomy_menu_delete_all()
- taxonomy_menu_taxonomy_vocabulary_delete in ./
taxonomy_menu.module - Implements hook_taxonomy_vocabulary_delete().
- _taxonomy_menu_rebuild in ./
taxonomy_menu.module - Rebuilds a menu.
File
- ./
taxonomy_menu.database.inc, line 65 - Database functions
Code
function _taxonomy_menu_delete_all($vid) {
$menu_terms = _taxonomy_menu_get_menu_items($vid);
if (!empty($menu_terms)) {
foreach ($menu_terms as $tid => $mlid) {
db_delete('menu_links')
->condition('mlid', $mlid)
->execute();
}
db_delete('taxonomy_menu')
->condition('vid', $vid)
->execute();
}
}