You are here

function menu_node_menu_link_insert in Menu Node API 7

Implements hook_menu_link_insert().

File

./menu_node.module, line 14
Menu Node API Manages relationships between the {node} and {menu_links} table.

Code

function menu_node_menu_link_insert($link) {
  if ($link['router_path'] != 'node/%' || !isset($link['mlid'])) {
    return;
  }
  $nid = str_replace('node/', '', $link['link_path']);
  if ($node = node_load($nid)) {
    menu_node_record_save($node, $link);
  }
}