function taxonomy_vocabulary_get_names

taxonomy_vocabulary_get_names()

Get names for all taxonomy vocabularies.

Return value

array A list of existing vocabulary IDs.

File

core/modules/taxonomy/taxonomy.module, line 296
Enables the organization of content into categories.

Code

function taxonomy_vocabulary_get_names() {
  $names = &drupal_static(__FUNCTION__);

  if (!isset($names)) {
    $names = array();
    $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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!taxonomy!taxonomy.module/function/taxonomy_vocabulary_get_names/8.1.x