menu_delete_item

Versions
4.6
menu_delete_item($mid)
4.7 – 5
menu_delete_item($item)

Delete a menu item from the database. If $item['mid'] is specified, then this is used to find the existing item; otherwise, $item['path'] is used.

Parameters

$item The menu item to be deleted.

▾ 3 functions call menu_delete_item()

menu_confirm_delete_form_submit in modules/menu.module
Process menu delete form submissions.
menu_node_form_delete in modules/menu.module
Remove the menu item.
menu_reset_item_form_submit in modules/menu.module
Process menu reset item form submissions.

Code

modules/menu.module, line 588

<?php
function menu_delete_item($item) {
  if (!is_array($item)) {
    $item = array('mid' => $item);
  }

  if ($item['mid']) {
    db_query('DELETE FROM {menu} WHERE mid = %d', $item['mid']);
  }
  elseif ($item['path']) {
    db_query("DELETE FROM {menu} WHERE path = '%s'", $item['path']);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.