You are here

function menu_node_delete in Drupal 7

Implements hook_node_delete().

File

modules/menu/menu.module, line 578
Allows administrators to customize the site's navigation menus.

Code

function menu_node_delete($node) {

  // Delete all menu module links that point to this node.
  $result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(
    ':path' => 'node/' . $node->nid,
  ), array(
    'fetch' => PDO::FETCH_ASSOC,
  ));
  foreach ($result as $m) {
    menu_link_delete($m['mlid']);
  }
}