function node_type_get_names
Returns a list of available node type names.
This list can include types that are queued for addition or deletion.
Return value
string[] An array of node type labels, keyed by the node type name.
Deprecated
in drupal:11.3.0 and is removed from drupal:13.0.0. Use \Drupal::service('entity_type.bundle.info')->getBundleLabels('node') instead.
See also
https://www.drupal.org/node/3534849
File
-
core/
modules/ node/ node.module, line 98
Code
function node_type_get_names() {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.3.0 and is removed from drupal:13.0.0. Use \\Drupal::service(\'entity_type.bundle.info\')->getBundleLabels(\'node\') instead. See https://www.drupal.org/node/3534849', E_USER_DEPRECATED);
return \Drupal::service('entity_type.bundle.info')->getBundleLabels('node');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.