You are here

function taxonomy_menu_group_delete in Taxonomy menu 6.3

1 call to taxonomy_menu_group_delete()
taxonomy_menu_group_delete_confirm_submit in ./taxonomy_menu.admin.inc

File

./taxonomy_menu.admin.inc, line 868
admin section for taxonomy menu

Code

function taxonomy_menu_group_delete($mgid, $name = NULL) {

  // Load the menu group if no name is passed.
  if (!$name) {
    $menu_group = taxonomy_menu_get_group($mgid);
    $name = $menu_group->name;
  }

  //delete the relationsip between the term sets and menu group
  db_query('DELETE FROM {taxonomy_menu_group_term_set} WHERE mgid = %d', $mgid);

  //delete the menu group options
  _taxonomy_menu_options_delete_by_parent($mgid, 'GROUP');

  //delete the menu group
  db_query('DELETE FROM {taxonomy_menu_group} WHERE mgid = %d', $mgid);

  // Inform the user that the menu group has been deleted
  drupal_set_message(t('Menu Group %menu_group has been deleted', array(
    '%menu_group' => $name,
  )));
}