You are here

function views_attach_library_uninstall in Views Attach Library 8

Same name and namespace in other branches
  1. 8.x views_attach_library.install \views_attach_library_uninstall()
  2. 2.0.x views_attach_library.install \views_attach_library_uninstall()

Implements hook_uninstall().

File

./views_attach_library.install, line 23
Various install/uninstall hooks for the attach library views module.

Code

function views_attach_library_uninstall() {

  // Disable library_in_views_display_extender plugin.
  $config = \Drupal::service('config.factory')
    ->getEditable('views.settings');
  $display_extenders = $config
    ->get('display_extenders') ?: [];
  $key = array_search('library_in_views_display_extender', $display_extenders);
  if ($key !== FALSE) {
    unset($display_extenders[$key]);
    $config
      ->set('display_extenders', $display_extenders);
    $config
      ->save();
  }
}