function menu_delete_item in Drupal 4
Same name and namespace in other branches
- 5 modules/menu/menu.module \menu_delete_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 calls to 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.
File
- modules/
menu.module, line 588 - Allows administrators to customize the site navigation menu.
Code
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']);
}
}