node_type_get_type

Versions
7
node_type_get_type($node)

Returns the node type of the passed node or node type string.

<?php

array(
'type' => 'Machine readable type name',
'name' => 'Name of the node type',
'base' => 'Indicates to which module this node type belongs',
'description' => 'Description of the node type',
// ...
  )

?>

Parameters

$node A node object or string that indicates the node type to return.

Return value

A single node type, as an object or FALSE if the node type is not found. The node type is an array with following content:

▾ 10 functions call node_type_get_type()

forum_form in modules/forum/forum.module
Implement hook_form().
hook_field_extra_fields in modules/field/field.api.php
Expose "pseudo-field" components on fieldable objects.
hook_form in modules/node/node.api.php
Display a node editing form.
node_assign_owner_action in modules/node/node.module
Implement a configurable Drupal action. Assigns ownership of a node to a user.
node_help in modules/node/node.module
Implement hook_help().
node_list_permissions in modules/node/node.module
Helper function to generate standard node permission list for a given type.
node_type_delete in modules/node/node.module
Deletes a node type from the database.
node_type_load in modules/node/node.module
Menu argument loader; Load a node type by string.
node_validate in modules/node/node.module
Perform validation checks on the given node.
poll_form in modules/poll/poll.module
Implement hook_form().

Code

modules/node/node.module, line 374

<?php
function node_type_get_type($node) {
  $type = _node_extract_type($node);
  $types = _node_types_build()->types;
  return isset($types[$type]) ? $types[$type] : FALSE;
}
?>
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.