You are here

function mass_contact_uninstall in Mass Contact 7

Same name and namespace in other branches
  1. 8 mass_contact.install \mass_contact_uninstall()
  2. 5.2 mass_contact.install \mass_contact_uninstall()
  3. 5 mass_contact.install \mass_contact_uninstall()
  4. 6 mass_contact.install \mass_contact_uninstall()

Implements hook_uninstall().

File

./mass_contact.install, line 286
Install, update and uninstall functions for the Mass Contact module.

Code

function mass_contact_uninstall() {

  // Delete all of the variables defined by this module.
  db_delete('variable')
    ->condition('name', 'mass_contact_%', 'LIKE')
    ->execute();

  // Delete all of the fields defined by this module.
  foreach (array_keys(_mass_contact_fields()) as $field) {
    field_delete_field($field);
  }

  // Delete all the field instances attached to the mass_contact node type.
  $instances = field_info_instances('node', 'mass_contact');
  foreach ($instances as $instance) {
    field_delete_instance($instance);
  }

  // Delete the node type.
  node_type_delete('mass_contact');

  // Purge all field information.
  field_purge_batch(1000);
}