function taxonomy_vocabulary_get_names

Same name in other branches
  1. 9 core/modules/taxonomy/taxonomy.module \taxonomy_vocabulary_get_names()
  2. 8.9.x core/modules/taxonomy/taxonomy.module \taxonomy_vocabulary_get_names()

Get names for all taxonomy vocabularies.

Return value

An associative array of objects keyed by vocabulary machine name with information about taxonomy vocabularies. Each object has properties:

  • name: The vocabulary name.
  • machine_name: The machine name.
  • vid: The vocabulary ID.
6 calls to taxonomy_vocabulary_get_names()
forum_entity_info_alter in modules/forum/forum.module
Implements hook_entity_info_alter().
TaxonomyVocabularyTestCase::testTaxonomyVocabularyLoadMultiple in modules/taxonomy/taxonomy.test
Tests for loading multiple vocabularies.
taxonomy_autocomplete in modules/taxonomy/taxonomy.pages.inc
Page callback: Outputs JSON for taxonomy autocomplete suggestions.
taxonomy_entity_info in modules/taxonomy/taxonomy.module
Implements hook_entity_info().
taxonomy_entity_query_alter in modules/taxonomy/taxonomy.module
Implements hook_entity_query_alter().

... See full list

1 string reference to 'taxonomy_vocabulary_get_names'
taxonomy_vocabulary_static_reset in modules/taxonomy/taxonomy.module
Clear all static cache variables for vocabularies.

File

modules/taxonomy/taxonomy.module, line 1000

Code

function taxonomy_vocabulary_get_names() {
    $names =& drupal_static(__FUNCTION__);
    if (!isset($names)) {
        $names = db_query('SELECT name, machine_name, vid FROM {taxonomy_vocabulary}')->fetchAllAssoc('machine_name');
    }
    return $names;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.