node_invoke

Versions
4.6 – 6
node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)
7
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 functions call node_invoke()

node_build_content in modules/node/node.module
Builds a structured array representing the node's content.
node_delete_multiple in modules/node/node.module
Delete multiple nodes.
node_save in modules/node/node.module
Save changes to a node or add a new node.
node_validate in modules/node/node.module
Perform validation checks on the given node.

Code

modules/node/node.module, line 817

<?php
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 or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.