node_invoke

Definition

node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)
modules/node.module, line 292

Description

Invoke a node hook.

Parameters

&$node Either a node object, node array, 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.

Code

<?php
function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
  $function = node_get_module_name($node) ."_$hook";

  if (function_exists($function)) {
    return ($function($node, $a2, $a3, $a4));
  }
}
?>
 
 

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.