1. drupal
    1. 6
    2. 8
    3. 7
6 – 8 menu_link_delete($mlid, $path = NULL)

Delete one or several menu links.


$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

▾ 9 functions call menu_link_delete()

book_node_delete in modules/book/book.module
Implements hook_node_delete().
book_remove_form_submit in modules/book/
Confirm form submit function to remove a node from the book.
MenuLinksUnitTestCase::testMenuLinkReparenting in modules/simpletest/tests/menu.test
Test automatic reparenting of menu links.
menu_delete_menu_confirm_submit in modules/menu/
Delete a custom menu and all links in it.
menu_item_delete_form_submit in modules/menu/
Process menu delete form submissions.
menu_link_maintain in includes/
Insert, update or delete an uncustomized menu link related to a module.
menu_node_delete in modules/menu/menu.module
Implements hook_node_delete().
menu_node_save in modules/menu/menu.module
Helper for hook_node_insert() and hook_node_update().
shortcut_link_delete_submit in modules/shortcut/
Submit handler for shortcut_link_delete_submit().


includes/, line 2930

function menu_link_delete($mlid, $path = NULL) {
  if (isset($mlid)) {
    _menu_delete_item(db_query("SELECT * FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchAssoc());
  else {
    $result = db_query("SELECT * FROM {menu_links} WHERE link_path = :link_path", array(':link_path' => $path));
    foreach ($result as $link) {