function hook_features_revert in Features 7.2
Same name and namespace in other branches
- 6 features.api.php \hook_features_revert()
- 7 features.api.php \hook_features_revert()
Component hook. Reverts all component objects for a given feature module.
The hook should be implemented using the name of the component, not the module, eg. [component]_features_revert() rather than [module]_features_export().
Parameters
string $module_name: The name of the feature module whose components should be reverted.
Return value
bool|void TRUE or FALSE for whether the components were successfully reverted. NOTE: This return value is no longer used in the latest Features so modules should no longer count on this value
18 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.
- contact_categories_features_revert in includes/
features.contact.inc - Implements hook_features_revert().
- 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 - Drush command callback for 'features-revert'.
File
- ./
features.api.php, line 237 - Hooks provided by the features module.
Code
function hook_features_revert($module_name) {
$mycomponents = module_invoke($module_name, 'mycomponent_defaults');
if (!empty($mycomponents)) {
foreach ($mycomponents as $mycomponent) {
mycomponent_delete($mycomponent);
}
}
}