| 5 node.module | node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) |
| 6 node.module | node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) |
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.
File
- modules/
node/ node.module, line 514 - 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
<?php
function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
$return = array();
foreach (module_implements('nodeapi') as $name) {
$function = $name . '_nodeapi';
$result = $function($node, $op, $a3, $a4);
if (isset($result) && is_array($result)) {
$return = array_merge($return, $result);
}
else if (isset($result)) {
$return[] = $result;
}
}
return $return;
}
?>Login or register to post comments