node_hook

Versions
4.6 – 6
node_hook(&$node, $hook)
7
node_hook($node, $hook)

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.

▾ 7 functions call node_hook()

book_print in modules/book.module
Menu callback; generates printer-friendly book page with all descendants.
book_print_recurse in modules/book.module
hook_update_index in developer/hooks/core.php
Update Drupal's full-text index for this module.
node_feed in modules/node.module
A generic function for generating RSS feeds from a set of nodes.
node_search in modules/node.module
Implementation of hook_search().
node_update_index in modules/node.module
Implementation of hook_update_index().
node_view in modules/node.module
Generate a display of the given node.

Code

modules/node.module, line 274

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

  return function_exists($function);
}
?>
Login or register to post comments
 
 

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.