You are here

function paragraphs_features_revert in Paragraphs 7

Implements hook_features_revert().

1 call to paragraphs_features_revert()
paragraphs_features_rebuild in ./paragraphs.features.inc
Implements hook_features_rebuild().

File

./paragraphs.features.inc, line 85
Holds features implementation.

Code

function paragraphs_features_revert($module = NULL) {
  if ($default_types = features_get_default('paragraphs', $module)) {
    foreach ($default_types as $type_name => $type_info) {
      db_delete('paragraphs_bundle')
        ->condition('bundle', $type_name)
        ->execute();
      $bundle = new stdClass();
      $bundle->bundle = $type_info['bundle'];
      $bundle->locked = $type_info['locked'];
      $bundle->name = $type_info['name'];
      $bundle->label = $type_info['label'];
      $bundle->description = $type_info['description'];
      paragraphs_bundle_save($bundle);
    }
    paragraphs_bundle_load(NULL, TRUE);
    menu_rebuild();
  }
}