function node_invoke
7.x node.module | node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) |
6.x node.module | node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) |
Invokes 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()
- node_build_content in drupal-7.x/
modules/ node/ node.module - Builds a structured array representing the node's content.
- node_delete_multiple in drupal-7.x/
modules/ node/ node.module - Deletes multiple nodes.
- node_object_prepare in drupal-7.x/
modules/ node/ node.module - Prepares a node object for editing.
- node_save in drupal-7.x/
modules/ node/ node.module - Saves changes to a node or adds a new node.
File
- drupal-7.x/
modules/ node/ node.module, line 911 - 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));
}
}