function message_subscribe_email_uninstall in Message Subscribe 7
Implements hook_uninstall().
File
- message_subscribe_email/
message_subscribe_email.install, line 67 - Install, update, and uninstall functions for the message_subscribe_email module.
Code
function message_subscribe_email_uninstall() {
// Delete field instance from user.
$field = field_info_instance('user', 'message_subscribe_email', 'user');
field_delete_instance($field);
// Revert message to default values if they haven't been changed.
$variables = array(
'message_subscribe_node' => 'subscribe_node_email:default',
'message_subscribe_term' => 'subscribe_taxonomy_term_email:default',
'message_subscribe_user' => 'subscribe_user_email:default',
// Revert OG in case it exists.
'message_subscribe_og' => 'subscribe_node_email:default',
);
foreach ($variables as $name => $value) {
if (variable_get($name) == $value) {
variable_del($name);
}
}
}