You are here

function hook_features_revert in Features 7

Same name and namespace in other branches
  1. 6 features.api.php \hook_features_revert()
  2. 7.2 features.api.php \hook_features_revert()

Component hook. The hook should be implemented using the name ot the component, not the module, eg. [component]_features_export() rather than [module]_features_export().

Revert all component objects for a given feature module.

Parameters

string $module_name: The name of the feature module whose components should be reverted.

Return value

boolean TRUE or FALSE for whether the components were successfully reverted.

15 functions implement hook_features_revert()

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

context_features_revert in includes/features.context.inc
Implements hook_features_revert().
ctools_component_features_revert in includes/features.ctools.inc
Master implementation of hook_features_revert() for all ctools components.
dependencies_features_revert in includes/features.features.inc
Implements hook_features_revert().
drush_features_revert in ./features.drush.inc
Revert a feature to it's code definition. Optionally accept a list of components to revert.
field_features_revert in includes/features.field.inc
Implements hook_features_revert().

... See full list

File

./features.api.php, line 185

Code

function hook_features_revert($module_name) {
  $mycomponents = module_invoke($module_name, 'mycomponent_defaults');
  if (!empty($mycomponents)) {
    foreach ($mycomponents as $mycomponent) {
      mycomponent_delete($mycomponent);
    }
  }
}