1.20.x node.module node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)

Invokes a node hook.

Parameters

Node|string $node: A node entity 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

mixed: The returned value of the invoked hook.

File

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

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));
  }
}