function taxonomy_vocabulary_get_names

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

Get names for all taxonomy vocabularies.

Return value

array A list of existing vocabulary IDs.

5 calls to taxonomy_vocabulary_get_names()
NodeTermData::init in core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
Overrides \Drupal\views\Plugin\views\HandlerBase::init().
taxonomy_term_load_multiple_by_name in core/modules/taxonomy/taxonomy.module
Try to map a string to an existing term, as for glossary use.
Term::init in core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php
Initialize the plugin.
Tid::init in core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
Initialize the plugin.
VocabularyCrudTest::testTaxonomyVocabularyLoadMultiple in core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
Tests for loading multiple vocabularies.
1 string reference to 'taxonomy_vocabulary_get_names'
VocabularyStorage::resetCache in core/modules/taxonomy/src/VocabularyStorage.php
Resets the internal, static entity cache.

File

core/modules/taxonomy/taxonomy.module, line 330

Code

function taxonomy_vocabulary_get_names() {
    $names =& drupal_static(__FUNCTION__);
    if (!isset($names)) {
        $names = [];
        $config_names = \Drupal::configFactory()->listAll('taxonomy.vocabulary.');
        foreach ($config_names as $config_name) {
            $id = substr($config_name, strlen('taxonomy.vocabulary.'));
            $names[$id] = $id;
        }
    }
    return $names;
}

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