node_invoke
modules/node/node.module, строка 645
- Версии
- 5 – 6
node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL)
Invoke a node hook.
Параметры
&$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.
Возвращаемое значение
The returned value of the invoked hook.
Код
<?php
function node_invoke(&$node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
if (node_hook($node, $hook)) {
$module = node_get_types('module', $node);
if ($module == 'node') {
$module = 'node_content'; // Avoid function name collisions.
}
$function = $module .'_'. $hook;
return ($function($node, $a2, $a3, $a4));
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии