| 6 taxonomy.module | taxonomy_vocabulary_load($vid, |
| 7 taxonomy.module | taxonomy_vocabulary_load($vid) |
| 8 taxonomy.module | taxonomy_vocabulary_load($vid) |
Return the vocabulary object matching a vocabulary ID.
Parameters
$vid: The vocabulary's ID.
Return value
The vocabulary object with all of its metadata, if exists, FALSE otherwise. Results are statically cached.
See also
taxonomy_vocabulary_machine_name_load()
20 calls to taxonomy_vocabulary_load()
1 string reference to 'taxonomy_vocabulary_load'
File
- modules/
taxonomy/ taxonomy.module, line 1244 - Enables the organization of content into categories.
Code
function taxonomy_vocabulary_load($vid) {
$vocabularies = taxonomy_vocabulary_load_multiple(array($vid));
return reset($vocabularies);
}
Login or register to post comments
Comments
print_r($result);
Example print_r($result) from this command from Drupal 7. Results may vary depending on other modules you have installed, but the structure should be useful:
stdClass Object
(
[vid] => 2
[name] => Sections
[machine_name] => sections
[description] =>
[hierarchy] => 0
[module] => taxonomy
[weight] => 0
[rdf_mapping] => Array
(
[rdftype] => Array
(
[0] => skos:ConceptScheme
)
[name] => Array
(
[predicates] => Array
(
[0] => dc:title
)
)
[description] => Array
(
[predicates] => Array
(
[0] => rdfs:comment
)
)
)
)
loading by machine name instead of vid
To retrieve a vocabulary by machine name instead of vid, use taxonomy_vocabulary_machine_name_load().