function hook_modules_uninstalled
hook_modules_uninstalled($modules)
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
Related topics
File
- modules/system/system.api.php, line 2722
- 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(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_modules_uninstalled/7.x