Skip to content

Instantly share code, notes, and snippets.

@stevesmename
Created September 13, 2012 10:49
Show Gist options
  • Save stevesmename/3713541 to your computer and use it in GitHub Desktop.
Save stevesmename/3713541 to your computer and use it in GitHub Desktop.
Drupal 6.x Uninstall method for best removing variables.
function hook_uninstall() {
// Remove module variables.
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'hook_%'");
while ($var_name = db_result($result)) {
variable_del($var_name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment