You are here

function menu_link_delete in Drupal 6

Same name and namespace in other branches
  1. 7 includes/menu.inc \menu_link_delete()

Delete one or several menu links.

Parameters

$mlid: A valid menu link mlid or NULL. If NULL, $path is used.

$path: The path to the menu items to be deleted. $mlid must be NULL.

Related topics

6 calls to menu_link_delete()
book_nodeapi in modules/book/book.module
Implementation of hook_nodeapi().
book_remove_form_submit in modules/book/book.pages.inc
Confirm form submit function to remove a node from the book.
menu_delete_menu_confirm_submit in modules/menu/menu.admin.inc
Delete a custom menu and all items in it.
menu_item_delete_form_submit in modules/menu/menu.admin.inc
Process menu delete form submissions.
menu_link_maintain in includes/menu.inc
Insert, update or delete an uncustomized menu link related to a module.

... See full list

File

includes/menu.inc, line 1846
API for the Drupal menu system.

Code

function menu_link_delete($mlid, $path = NULL) {
  if (isset($mlid)) {
    _menu_delete_item(db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE mlid = %d", $mlid)));
  }
  else {
    $result = db_query("SELECT * FROM {menu_links} WHERE link_path = '%s'", $path);
    while ($link = db_fetch_array($result)) {
      _menu_delete_item($link);
    }
  }
}