You are here

function newsletter_uninstall in Newsletter 7

Same name and namespace in other branches
  1. 7.2 newsletter.install \newsletter_uninstall()

Implements hook_uninstall().

File

./newsletter.install, line 66
Contains install,uninstall and update functions for Newsletter module.

Code

function newsletter_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE 'newsletter_%'");
  $mail_modes = variable_get('mail_system');
  unset($mail_modes['newsletter']);
  variable_set('mail_system', $mail_modes);
  $fields_instances = newsletter_fields_instances();
  foreach ($fields_instances['instance'] as $data) {
    field_delete_instance($data);
  }
  field_purge_batch(10);

  // Delete newsletter categories vocabulary if exists
  $vocabulary = taxonomy_vocabulary_machine_name_load('newsletter_categories');
  if ($vocabulary) {
    taxonomy_vocabulary_delete($vocabulary->vid);
  }
}