1 node.module node_type_get_type($node)

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

Parameters

Node|string $node: A node entity or string that indicates the node type to return.

Return value

stdClass|FALSE 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 a node type's config file, merged with the defaults from node_type_set_defaults().

File

core/modules/node/node.module, line 398
The core module that allows content to be submitted to the site.

Code

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