function hook_taxonomy_vocabulary_load

Act on taxonomy vocabularies when loaded.

Modules implementing this hook can act on the vocabulary objects before they are returned by taxonomy_vocabulary_load_multiple().

Parameters

array $vocabularies: An array of taxonomy vocabulary entities.

Related topics

1 function implements hook_taxonomy_vocabulary_load()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_crud_hook_test_taxonomy_vocabulary_load in drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.module
Implements hook_taxonomy_vocabulary_load().

File

drupal/core/modules/taxonomy/taxonomy.api.php, line 39
Hooks provided by the Taxonomy module.

Code

function hook_taxonomy_vocabulary_load(array $vocabularies) {
  $result = db_select('mytable', 'm')
    ->fields('m', array(
    'vid',
    'foo',
  ))
    ->condition('m.vid', array_keys($vocabularies), 'IN')
    ->execute();
  foreach ($result as $record) {
    $vocabularies[$record->vid]->foo = $record->foo;
  }
}