You are here

function entityqueue_uninstall in Entityqueue 7

Implements hook_uninstall().

File

./entityqueue.install, line 174
Install, update and uninstall functions for the Entityqueue module.

Code

function entityqueue_uninstall() {

  // Delete entityqueue's field instances.
  $queues = variable_get('entityqueue_queue_names', array());
  foreach ($queues as $name) {
    field_attach_delete_bundle('entityqueue_subqueue', $name);
  }

  // Build an array of entityreference field names created by entityqueue.
  $eq_fields = variable_get('entityqueue_field_names', array());
  $eq_fields = array_unique($eq_fields);

  // Remove fields attached to entity queues (bundles).
  foreach ($eq_fields as $field_name) {
    field_delete_field($field_name);
  }
  variable_del('entityqueue_queue_names');
  variable_del('entityqueue_field_names');
}