1 menu.module menu_node_predelete(Node $node)

Implements hook_node_predelete().

File

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

Code

function menu_node_predelete(Node $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']);
  }
}