function hook_menu_node_invoke_delete in Menu Node API 7
When a node or its menu item are deleted, notify other modules.
Note that this hook runs for each menu item that belongs to the node (yes, core allows that), so normally you would use $link->mlid as the primary key.
Parameters
$link: An object representing a single row from the {menu_links} table. This object defines the menu link and can be used to load additional data using menu_get_item().
$node: The node object being acted upon.
1 function implements hook_menu_node_invoke_delete()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- menu_node_test_menu_node_invoke_delete in tests/
menu_node_test.module - Implements hook_menu_node_invoke_delete().
File
- ./
menu_node.api.php, line 73 - Menu Node API API documentation file for the Menu Node API module.
Code
function hook_menu_node_invoke_delete($link, $node) {
// Delete data in my custom table, which tracks the owners of nodes
// placed in the site menu.
db_delete('mytable')
->condition('mlid', $link->mlid)
->execute();
}