You are here

function metatag_features_revert in Metatag 7

Implements hook_features_revert().

1 call to metatag_features_revert()
metatag_features_rebuild in ./metatag.features.inc
Implements hook_features_rebuild().

File

./metatag.features.inc, line 59
Features integration for the Metatag module.

Code

function metatag_features_revert($module) {
  if ($feature_conf = features_get_default('metatag', $module)) {
    foreach (array_keys($feature_conf) as $config) {
      if ($conf = metatag_config_load($config)) {
        db_delete('metatag_config')
          ->condition('instance', $config)
          ->execute();
      }
      unset($feature_conf[$config]['cid']);
      $object = new stdClass();
      $object->cid = NULL;
      $object->instance = $config;
      $object->config = $feature_conf[$config]['config'];
      metatag_config_save($object);
      if (!empty($feature_conf[$config]['disabled'])) {
        ctools_export_crud_disable('metatag_config', $config);
      }
      else {
        ctools_export_crud_enable('metatag_config', $config);
      }
    }
  }
}