Commit 17a81ef6 authored by Arkener's avatar Arkener Committed by Robert Ragas

Issue #2610156 by Arkener: Cleaning variables on uninstall / content type deletion

parent 60055c2d
......@@ -159,3 +159,21 @@ function yoast_seo_install() {
}
}
}
/**
* Implements hook_uninstall().
*/
function yoast_seo_uninstall() {
$entity_type = 'node';
// Delete node entity variable.
variable_del('yoast_seo_enable_' . $entity_type);
// Also delete the variable for each entity bundle.
$entity_info = entity_get_info($entity_type);
if (!empty($entity_info['bundles'])) {
foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
variable_del('yoast_seo_enable_' . $entity_type . '__' . $bundle_name);
}
}
}
......@@ -773,6 +773,15 @@ function yoast_seo_configuration_save($entity_type, $entity_id, $revision_id, $s
}
}
/**
* Implements hook_node_type_delete().
*
* Remove configuration when the content type is removed.
*/
function yoast_seo_node_type_delete($info) {
variable_del('yoast_seo_enable_node__' . $info->type);
}
/**
* Implements hook_form_FORM_ID_alter().
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment