node_invoke

5 node.module node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)
6 node.module node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)
7 node.module node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)
8 node.module node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)

Invoke a node hook.

Parameters

$node: A node object 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.

4 calls to node_invoke()

File

modules/node/node.module, line 891
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
  if (node_hook($node, $hook)) {
    $base = node_type_get_base($node);
    $function = $base . '_' . $hook;
    return ($function($node, $a2, $a3, $a4));
  }
}
Login to post comments