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

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.