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 306
- Enables the organization of content into categories.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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 ; } |
Please login to continue.