function hook_menu_node_invoke_insert in Menu Node API 7
When a menu item is created for a node, notify other modules.
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.
See also
menu_save_item()
1 function implements hook_menu_node_invoke_insert()
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_insert in tests/
menu_node_test.module - Implements hook_menu_node_invoke_insert().
File
- ./
menu_node.api.php, line 23 - Menu Node API API documentation file for the Menu Node API module.
Code
function hook_menu_node_invoke_insert($link, $node) {
// Store data in my custom table, which tracks the owners of nodes
// placed in the site menu.
$record = array(
'nid' => $node->nid,
'mlid' => $link->mlid,
'uid' => $node->uid,
);
drupal_write_record('mytable', $record);
}