function hook_modules_uninstalled

Perform necessary actions after modules are uninstalled.

This function differs from hook_uninstall() in that it gives all other modules a chance to perform actions when a module is uninstalled, whereas hook_uninstall() is only called on the module actually being uninstalled.

It is recommended that you implement this hook if your module stores data that may have been set by other modules.

Parameters

$modules: An array of the modules that were uninstalled.

See also

hook_uninstall()

hook_modules_disabled()

Related topics

7 functions implement hook_modules_uninstalled()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

block_modules_uninstalled in drupal/core/modules/block/block.module
Implements hook_modules_uninstalled().
breakpoint_modules_uninstalled in drupal/core/modules/breakpoint/breakpoint.module
Implements hook_modules_uninstalled().
module_test_modules_uninstalled in drupal/core/modules/system/tests/modules/module_test/module_test.module
Implements hook_modules_uninstalled().
node_modules_uninstalled in drupal/core/modules/node/node.module
Implements hook_modules_uninstalled().
rdf_modules_uninstalled in drupal/core/modules/rdf/rdf.module
Implements hook_modules_uninstalled().

... See full list

1 invocation of hook_modules_uninstalled()
module_uninstall in drupal/core/includes/module.inc
Uninstalls a given list of modules.

File

drupal/core/modules/system/system.api.php, line 2263
Hooks provided by Drupal core and the System module.

Code

function hook_modules_uninstalled($modules) {
  foreach ($modules as $module) {
    db_delete('mymodule_table')
      ->condition('module', $module)
      ->execute();
  }
  mymodule_cache_rebuild();
}