function hook_taxonomy_vocabulary_load

hook_taxonomy_vocabulary_load($vocabularies)

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

$vocabulary: An array of taxonomy vocabulary objects.

Related topics

File

modules/taxonomy/taxonomy.api.php, line 22
Hooks provided by the Taxonomy module.

Code

function hook_taxonomy_vocabulary_load($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;
  }
}

© 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/modules!taxonomy!taxonomy.api.php/function/hook_taxonomy_vocabulary_load/7.x