You are here

function readmehelp_uninstall in README Help 8

Implements hook_uninstall().

Disabling the 'readmehelp_markdown' filter does not remove it from format available filters. Users may try to disable the format which allows to uninstall the module but this removes it from the UI without any chance to get it back. So, the clean up must be done on uninstall.

See also

https://www.drupal.org/project/drupal/issues/949220

https://www.drupal.org/project/drupal/issues/2502637

File

./readmehelp.install, line 21
Install and uninstall functions for the readmehelp module.

Code

function readmehelp_uninstall() {
  foreach (FilterFormat::loadMultiple() as $filter_format) {
    $filters = $filter_format
      ->getPluginCollections()['filters'];
    if ($filters
      ->has('readmehelp_markdown')) {
      $filters
        ->removeInstanceId('readmehelp_markdown');
    }
  }
}