You are here

function answers_uninstall in Answers 7.4

Same name and namespace in other branches
  1. 8 answers.install \answers_uninstall()
  2. 5.2 answers.install \answers_uninstall()
  3. 6.2 answers.install \answers_uninstall()
  4. 7.3 answers.install \answers_uninstall()

Implements hook_uninstall().

Removes from the system content types, fields and variables related with question and answer content types. Content itself (nodes) is left.

File

./answers.install, line 124
Install, update, and uninstall functions for the answers module.

Code

function answers_uninstall() {
  field_attach_delete_bundle('node', 'answers_question');
  field_attach_delete_bundle('node', 'answers_answer');
  field_purge_batch(1000);
  db_delete('variable')
    ->condition(db_or()
    ->condition('name', '%_answers_question', 'LIKE')
    ->condition('name', '%_answers_answer', 'LIKE'))
    ->execute();
}