function node_type_get_names
Same name in other branches
- 7.x 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()
- 11.x 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.
3 calls to node_type_get_names()
- BookSettingsForm::buildForm in core/
modules/ book/ src/ Form/ BookSettingsForm.php - Form constructor.
- NodeSearch::searchFormAlter in core/
modules/ node/ src/ Plugin/ Search/ NodeSearch.php - Alters the search form when being built for a given plugin.
- NodeTypeTest::testNodeTypeGetFunctions in core/
modules/ node/ tests/ src/ Functional/ NodeTypeTest.php - Ensures that node type functions (node_type_get_*) work correctly.
File
-
core/
modules/ node/ node.module, line 225
Code
function node_type_get_names() {
return array_map(function ($bundle_info) {
return $bundle_info['label'];
}, \Drupal::service('entity_type.bundle.info')->getBundleInfo('node'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.