function hook_disable

Perform necessary actions before module is disabled.

The hook is called every time the module is disabled. It should be implemented in the module's .install file. The implementation can rely on the .module file being loaded.

See also

hook_uninstall()

hook_modules_disabled()

Related topics

8 functions implement hook_disable()

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

filter_test_filter_format_disable in drupal/core/modules/filter/tests/filter_test/filter_test.module
Implements hook_filter_format_disable().
language_disable in drupal/core/modules/language/language.install
Implements hook_disable().
language_types_disable in drupal/core/includes/language.inc
Disables the given language types.
module_disable in drupal/core/includes/module.inc
Disables a given set of modules.
node_access_test_language_disable in drupal/core/modules/node/tests/modules/node_access_test_language/node_access_test_language.module
Implements hook_disable().

... See full list

1 invocation of hook_disable()
ModuleHandler::disable in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Disables a given set of modules.

File

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

Code

function hook_disable() {
  mymodule_cache_rebuild();
}