By tim.plunkett on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
node_type_get_type() was removed, because it is obsolete.
node_type_load() and the $type property on Node entities are sufficient replacements.
Drupal 7
$type = node_type_get_type('my_type');
print $type->type; // yields: 'my_type'
$node = node_load(123);
$type = node_type_get_type($node);
print $type->type; // yields: 'my_type'
Drupal 8
$type = node_type_load('my_type');
print $type->type; // yields: 'my_type'
$node = node_load(123);
print $node->type; // yields: 'my_type'
Note: node_type_load() was previously used as a menu argument loader function for %node_type and thus had to convert hyphens/dashes in the node/content type machine names into underscores. This conversion has been removed; see http://drupal.org/node/1574668.
Impacts:
Module developers