You are here

function collapsiblock_uninstall in Collapsiblock 8

Same name and namespace in other branches
  1. 6 collapsiblock.install \collapsiblock_uninstall()
  2. 7.2 collapsiblock.install \collapsiblock_uninstall()
  3. 7 collapsiblock.install \collapsiblock_uninstall()

Implements hook_uninstall().

File

./collapsiblock.install, line 13
Install, update and uninstall functions for the devel module.

Code

function collapsiblock_uninstall() {
  $blocks = Block::loadMultiple();
  foreach ($blocks as $block) {
    if (!empty($block
      ->get('collapsiblock'))) {
      \Drupal::configFactory()
        ->getEditable('block.block.' . $block
        ->get('id'))
        ->clear('collapsiblock')
        ->save();
    }
  }
  drupal_flush_all_caches();
}