function node_type_load

node_type_load($name)

Menu argument loader: loads a node type by string.

Parameters

$name: The machine-readable name of a node type to load, where '_' is replaced with '-'.

Return value

A node type object or FALSE if $name does not exist.

File

modules/node/node.module, line 489
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_type_load($name) {
  return node_type_get_type(strtr($name, array('-' => '_')));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!node!node.module/function/node_type_load/7.x