You are here

function rabbit_hole_uninstall in Rabbit Hole 6

Same name and namespace in other branches
  1. 7 rabbit_hole.install \rabbit_hole_uninstall()

Implements hook_uninstall().

File

./rabbit_hole.install, line 46
Install, update and uninstall functions for Rabbit Hole.

Code

function rabbit_hole_uninstall() {

  // Remove variables.
  $node_types = array_keys(node_type_get_types());
  foreach ($node_types as $node_type) {
    variable_del('rabbit_hole_action_' . $node_type);
    variable_del('rabbit_hole_redirect_' . $node_type);
    variable_del('rabbit_hole_redirect_response_' . $node_type);
  }

  // Drop our fields from the {node} table.
  $schema['node'] = array();
  rabbit_hole_schema_alter($schema);
  $ret = array();
  foreach ($schema['node']['fields'] as $name => $spec) {
    db_drop_field($ret, 'node', $name);
  }
}