You are here

function _taxonomy_menu_delete_all in Taxonomy menu 6.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.database.inc \_taxonomy_menu_delete_all()
  2. 7.2 taxonomy_menu.database.inc \_taxonomy_menu_delete_all()
  3. 7 taxonomy_menu.database.inc \_taxonomy_menu_delete_all()

Delete all links associated with this vocab from both the taxonomy_menu table and the menu_link table.

Parameters

$vid: vocabulary's id

2 calls to _taxonomy_menu_delete_all()
taxonomy_menu_taxonomy in ./taxonomy_menu.module
Implementation of hook_taxonomy().
_taxonomy_menu_rebuild in ./taxonomy_menu.module
rebuilds a menu

File

./taxonomy_menu.database.inc, line 59
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_query('DELETE FROM {menu_links} WHERE mlid = %d', $mlid);
    }
    db_query('DELETE FROM {taxonomy_menu} WHERE vid = %d', $vid);
  }
}