1. drupal
    1. 8
    2. 7
8 – 7 node_type_get_type($node)

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


$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 object containing fields from hook_node_info() return values, as well as the field 'type' (the machine-readable type) and other fields used internally and defined in _node_types_build(), hook_node_info(), and node_type_set_defaults().

▾ 13 functions call node_type_get_type()

comment_node_type_load in modules/comment/comment.module
Menu loader callback for Field UI paths.
DrupalWebTestCase::drupalCreateContentType in modules/simpletest/drupal_web_test_case.php
Creates a custom content type based on default settings.
forum_form in modules/forum/forum.module
Implements hook_form().
hook_form in modules/node/node.api.php
Display a node editing form.
NodeTypeTestCase::testNodeTypeGetFunctions in modules/node/node.test
Ensure that node type functions (node_type_get_*) work correctly.
node_content_form in modules/node/node.module
Implements hook_form().
node_help in modules/node/node.module
Implements 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: loads 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
Implements hook_form().
simpletest_example_form in examples/simpletest_example/simpletest_example.module
Implements hook_form().


modules/node/node.module, line 401

function node_type_get_type($node) {
  $type = _node_extract_type($node);
  $types = _node_types_build()->types;
  return isset($types[$type]) ? $types[$type] : FALSE;