You are here

public function CheeseburgerMenu::unsetNotSelected in Cheeseburger Menu 8.4

Unsets not selected array elements.

1 call to CheeseburgerMenu::unsetNotSelected()
CheeseburgerMenu::blockSubmit in src/Plugin/Block/CheeseburgerMenu.php
Sends and store the block by collected data.

File

src/Plugin/Block/CheeseburgerMenu.php, line 485
Cheeseburger class extends BlockBase.

Class

CheeseburgerMenu
Block info.

Namespace

Drupal\cheeseburger_menu\Plugin\Block

Code

public function unsetNotSelected(&$config_menus) {
  if (is_string($config_menus)) {
    $config_menus = [];
  }
  foreach ($config_menus as $id => &$config_menu) {
    if ((bool) $config_menu['select']) {
      unset($config_menu['select']);
    }
    else {
      unset($config_menus[$id]);
    }
  }
}