node_get_type_label(NodeInterface $node)
Returns the node type label for the passed node.
@todo Add this as generic helper method for config entities representing entity bundles.
Parameters
\Drupal\node\NodeInterface $node: A node entity to return the node type's label for.
Return value
string|false The node type label or FALSE if the node type is not found.
File
- core/modules/node/node.module, line 277
- The core module that allows content to be submitted to the site.
Code
1 2 3 4 | function node_get_type_label(NodeInterface $node ) { $type = NodeType::load( $node ->bundle()); return $type ? $type ->label() : FALSE; } |
Please login to continue.