function menu_node_delete in Menu Node API 6
Delete a record from {menu_node} and run hook_menu_node_delete().
We deliberately run the hook before the delete, in case any module wishes to run a JOIN on the {menu_node} table.
Parameters
$node: The node being deleted.
Return value
No return. hook_menu_node_delete() is invoked.
4 calls to menu_node_delete()
- menu_node_delete_form_submit in ./
menu_node.module - Custom form handler to react to menu item changes.
- menu_node_delete_menu_form_submit in ./
menu_node.module - Custom form handler to react to custom menu changes.
- menu_node_nodeapi in ./
menu_node.module - Implements hook_nodeapi().
- menu_node_update_6000 in ./
menu_node.install - Update function to remove book module entries.
File
- ./
menu_node.module, line 360 - Menu Node API Manages relationships between the {node} and {menu_links} table.
Code
function menu_node_delete($node) {
if (!empty($node->menu_node_items)) {
foreach ($node->menu_node_items as $item) {
module_invoke_all('menu_node_delete', $item, $node);
}
}
db_query("DELETE FROM {menu_node} WHERE nid = %d", $node->nid);
}