hook_node_types

Definition

hook_node_types()
developer/hooks/node.php, line 205

Description

Define multiple node types.

This is a hook used by node modules. This hook is only needed if a module needs to define more than one node type.

To prevent namespace conflicts, each node type defined by a module should be prefixed by the name of the module and a dash.

Return value

An array of node types defined by the module.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_node_types() {
  return array('project-issue', 'project-project');
}
?>
 
 

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.