function hook_features_revert in Features 6
Same name and namespace in other branches
- 7.2 features.api.php \hook_features_revert()
- 7 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.
17 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.
- content_features_revert in includes/
features.content.inc - Implementation of hook_features_revert().
- context_features_revert in includes/
features.context.inc - Implementation of 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 - Implementation of hook_features_revert().
- drush_features_revert in ./
features.drush.inc - Revert a feature to it's code definition.
File
- ./
features.api.php, line 177
Code
function hook_features_revert($module_name) {
$mycomponents = module_invoke_all($module_name, 'mycomponent_defaults');
if (!empty(${$mycomponents})) {
foreach ($mycomponents as $mycomponent) {
mycomponent_delete($mycomponent);
}
}
}