node_invoke_nodeapi
Definition
node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
modules/node.module, line 312
Description
Invoke a hook_nodeapi() operation in all modules.
Parameters
&$node A node object.
$op A string containing the name of the nodeapi operation.
$a3, $a4 Arguments to pass on to the hook, after the $node and $op arguments.
Return value
The returned value of the invoked hooks.
Code
<?php
function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
$return = array();
foreach (module_list() as $name) {
$function = $name .'_nodeapi';
if (function_exists($function)) {
$result = $function($node, $op, $a3, $a4);
if (is_array($result)) {
$return = array_merge($return, $result);
}
else if (isset($result)) {
$return[] = $result;
}
}
}
return $return;
}
?> 