Same name and namespace in other branches
  1. 4.7.x modules/node.module \node_invoke()
  2. 5.x modules/node/node.module \node_invoke()
  3. 6.x modules/node/node.module \node_invoke()
  4. 7.x modules/node/node.module \node_invoke()

Invoke a node hook.

Parameters

&$node: Either a node object, node array, or a string containing the node type.

$hook: A string containing the name of the hook.

$a2, $a3, $a4: Arguments to pass on to the hook, after the $node argument.

Return value

The returned value of the invoked hook.

20 calls to node_invoke()
blogapi_settings in modules/blogapi.module
book_print in modules/book.module
Menu callback; generates printer-friendly book page with all descendants.
book_print_recurse in modules/book.module
hook_update_index in developer/hooks/core.php
Update Drupal's full-text index for this module.
node_add in modules/node.module
Present a node submission form or a set of links to such forms.

... See full list

File

modules/node.module, line 292
The core that allows content to be submitted to the site.

Code

function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
  $function = node_get_module_name($node) . "_{$hook}";
  if (function_exists($function)) {
    return $function($node, $a2, $a3, $a4);
  }
}