1.12.x menu.inc menu_link_delete($mlid, $path = NULL)
1.10.x menu.inc menu_link_delete($mlid, $path = NULL)
1.11.x menu.inc menu_link_delete($mlid, $path = NULL)
1.7.x menu.inc menu_link_delete($mlid, $path = NULL)
1.8.x menu.inc menu_link_delete($mlid, $path = NULL)
1.9.x menu.inc menu_link_delete($mlid, $path = NULL)

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

File

includes/menu.inc, line 3113
API for the Backdrop menu system.

Code

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) {
      _menu_delete_item($link);
    }
  }
}