You are here

function hashtags_uninstall in Hashtags 7

Same name and namespace in other branches
  1. 8 hashtags.install \hashtags_uninstall()
  2. 6.2 hashtags.install \hashtags_uninstall()
  3. 6 hashtags.install \hashtags_uninstall()
  4. 7.2 hashtags.install \hashtags_uninstall()

Implementation of hook_uninstall().

File

./hashtags.install, line 50
Install, update and uninstall functions for the hashtags module.

Code

function hashtags_uninstall() {
  drupal_load('module', 'taxonomy');
  $vid = variable_get('hashtags_vocabulary', '');
  $field_name = variable_get('hashtags_terms_field', '');
  field_delete_field($field_name);
  taxonomy_vocabulary_delete($vid);

  // Purge field data now to allow taxonomy module to be uninstalled
  // if this is the only field remaining.
  field_purge_batch(11);
  variable_del('hashtags_vocabulary');
  variable_del('hashtags_terms_field');
  variable_del('hashtags_output_type');

  // Remove Hashtags filter out of all input formats
  $module = 'hashtags';
  db_query("DELETE FROM {filter} WHERE module = :module", array(
    ':module' => $module,
  ));

  // clear filter caches
  filter_formats_reset();
  drupal_set_message(t('Hashtags filter has been removed from all input format'));
  watchdog('Input format', t('Hashtags filter has been removed from all input format'));
}