You are here

public static function OgMenuBlock::processMenuLevelParents in Organic Groups Menu (OG Menu) 8

Form API callback: Processes the menu_levels field element.

Adjusts the #parents of menu_levels to save its children at the top level.

File

src/Plugin/Block/OgMenuBlock.php, line 156

Class

OgMenuBlock
Provides a generic Menu block.

Namespace

Drupal\og_menu\Plugin\Block

Code

public static function processMenuLevelParents(&$element, FormStateInterface $form_state, &$complete_form) {
  array_pop($element['#parents']);
  return $element;
}