You are here

function yoast_seo_uninstall in Real-time SEO for Drupal 7

Implements hook_uninstall().

File

./yoast_seo.install, line 100
Install, update, and uninstall functions for the Yoast SEO for Drupal module.

Code

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);
      variable_del('yoast_seo_body_fields_' . $bundle_name);
    }
  }
}