hook_uninstall()
Remove any information that the module sets.
The information that the module should remove includes:
The module should not remove its entry from the module configuration. Database tables defined by hook_schema() will be removed automatically.
The uninstall hook must be implemented in the module's .install file. It will fire when the module gets uninstalled but before the module's database tables are removed, allowing your module to query its own tables during this routine.
function hook_uninstall() { // Remove the styles directory and generated images. file_unmanaged_delete_recursive(file_default_scheme() . '://styles'); }
© 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/core!lib!Drupal!Core!Extension!module.api.php/function/hook_uninstall/8.1.x