You are here

function node_type_get_names in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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.

4 calls to node_type_get_names()
admin_toolbar_tools_menu_links_discovered_alter in modules/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module
Implements hook_menu_links_discovered_alter().
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/src/Tests/NodeTypeTest.php
Ensures that node type functions (node_type_get_*) work correctly.

File

core/modules/node/node.module, line 259
The core module that allows content to be submitted to the site.

Code

function node_type_get_names() {
  return array_map(function ($bundle_info) {
    return $bundle_info['label'];
  }, \Drupal::entityManager()
    ->getBundleInfo('node'));
}