8.5.x node.module node_type_get_names()
8.0.x node.module node_type_get_names()
8.1.x node.module node_type_get_names()
8.2.x node.module node_type_get_names()
8.3.x node.module node_type_get_names()
8.4.x node.module node_type_get_names()
8.6.x node.module node_type_get_names()
7.x 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. See _node_types_build() for details.

Return value

An array of node type names, keyed by the type.

7 calls to node_type_get_names()
book_admin_settings in modules/book/book.admin.inc
Form constructor for the book settings form.
NodeTypeTestCase::testNodeTypeGetFunctions in modules/node/node.test
Ensures that node type functions (node_type_get_*) work correctly.
node_filters in modules/node/node.admin.inc
List node administration filters that can be applied.
node_form_block_admin_configure_alter in modules/node/node.module
Implements hook_form_FORMID_alter().
node_form_search_form_alter in modules/node/node.module
Implements hook_form_FORM_ID_alter().

... See full list

File

modules/node/node.module, line 446
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_type_get_names() {
  return _node_types_build()->names;
}

Comments

vivek.bhadoria’s picture

You can get list of all node types using 'node_type_get_types' and in case want to select single value then use 'node_type_get_type'

rocket777’s picture

Returns something like

array {
["blog_entry"]=> "Blog entry" 
["rotator"]=> "Highlights Rotator" 
["press_release"]=> "News"
["site_page"]=>  "Site Page"
["webform"]=> "Webform" 
}