You are here

function flexslider_uninstall in Flex Slider 8.2

Same name and namespace in other branches
  1. 7.2 flexslider.install \flexslider_uninstall()
  2. 7 flexslider.install \flexslider_uninstall()

Implements hook_uninstall().

Deletes all content and configuration installed by this module.

File

./flexslider.install, line 13
Installation actions for FlexSlider.

Code

function flexslider_uninstall() {

  // Delete all of the configuration installed by this module.
  $dir = drupal_get_path('module', 'flexslider') . '/config/install';
  $files = \Drupal::service('file_system')
    ->scanDirectory($dir, '/.*/');
  foreach ($files as $file) {
    \Drupal::configFactory()
      ->getEditable($file->name)
      ->delete();
  }
  \Drupal::logger('flexslider')
    ->info(t('Deleted flexslider configuration'), []);
}