Same name and namespace in other branches
  1. 4.6.x modules/node.module \node_invoke_nodeapi()
  2. 4.7.x modules/node.module \node_invoke_nodeapi()
  3. 5.x modules/node/node.module \node_invoke_nodeapi()

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.

12 calls to node_invoke_nodeapi()
blogapi_blogger_edit_post in modules/blogapi/blogapi.module
Blogging API callback. Modifies the specified blog node.
blogapi_blogger_new_post in modules/blogapi/blogapi.module
Blogging API callback. Inserts a new blog post as a node.
hook_update_index in developer/hooks/core.php
Update Drupal's full-text index for this module.
node_build_content in modules/node/node.module
Builds a structured array representing the node's content.
node_delete in modules/node/node.module
Delete a node.

... See full list

File

modules/node/node.module, line 681
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_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;
}