admin's blog

Reverting Features and hook_post_features_revert() versus hook_update()

I'm working with a distro and I've been looking for a permanent solution to an issue I have with removing fields defined by the distro which the client does not need. I have used hook_update in the past like this. 

/**
* Remove unused fields from distro
*/
function mymodule_update_7101() {
if ($instance = field_info_instance('node', 'field_topics', 'blog')) {
field_delete_instance($instance, TRUE);
field_purge_batch(1);
}
...
}