function node_type_get_names
Same name and namespace in other branches
- 10 core/modules/node/node.module \node_type_get_names()
- 9 core/modules/node/node.module \node_type_get_names()
- 8.9.x core/modules/node/node.module \node_type_get_names()
- 7.x modules/node/node.module \node_type_get_names()
- main core/modules/node/node.module \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 102
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.