node_hook

Definition

node_hook(&$node, $hook)
modules/node.module, line 274

Description

Determine whether a node hook exists.

Parameters

&$node Either a node object, node array, or a string containing the node type.

$hook A string containing the name of the hook.

Return value

TRUE iff the $hook exists in the node type of $node.

Code

<?php
function node_hook(&$node, $hook) {
  $function = node_get_module_name($node) ."_$hook";

  return function_exists($function);
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.