You are here

function taxonomy_features_rebuild in Features 6

Same name and namespace in other branches
  1. 7.2 includes/features.taxonomy.inc \taxonomy_features_rebuild()
  2. 7 includes/features.taxonomy.inc \taxonomy_features_rebuild()

Implementation of hook_features_rebuild().

Rebuilds Taxonomy vocabularies from code defaults.

1 call to taxonomy_features_rebuild()
taxonomy_features_revert in includes/features.taxonomy.inc
Implementation of hook_features_revert().

File

includes/features.taxonomy.inc, line 81

Code

function taxonomy_features_rebuild($module) {
  if ($vocabularies = features_get_default('taxonomy', $module)) {
    foreach ($vocabularies as $machine_name => $vocabulary) {
      if ($vid = db_result(db_query("SELECT vid FROM {vocabulary} WHERE module = '%s'", 'features_' . $machine_name))) {
        $vocabulary['vid'] = $vid;
      }
      taxonomy_save_vocabulary($vocabulary);
    }
  }
}