You are here

function menu_import_delete_node_menuitem in Menu Export/Import 7

Deletes a menu item by node ID.

Parameters

$menuitem: Array describing the menu item.

1 call to menu_import_delete_node_menuitem()
menu_import_save_menu in includes/import.inc
Import menu items.

File

includes/import.inc, line 571
Import functions for menu_import module.

Code

function menu_import_delete_node_menuitem($menuitem) {
  $processed_items =& drupal_static(__FUNCTION__, array());
  $path = 'node/' . $menuitem['nid'];
  if (!in_array($path, $processed_items)) {
    $mlid = db_query('SELECT mlid FROM {menu_links} WHERE menu_name=:menu AND link_path=:path', array(
      ':menu' => $menuitem['menu_name'],
      ':path' => $path,
    ))
      ->fetchColumn();
    menu_link_delete($mlid);
    $processed_items[] = $path;
  }
}