function SystemMenuBlock::processMenuLevelParents

Same name in other branches
  1. 9 core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::processMenuLevelParents()
  2. 8.9.x core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::processMenuLevelParents()
  3. 11.x core/modules/system/src/Plugin/Block/SystemMenuBlock.php \Drupal\system\Plugin\Block\SystemMenuBlock::processMenuLevelParents()

Form API callback: Processes the menu_levels field element.

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

File

core/modules/system/src/Plugin/Block/SystemMenuBlock.php, line 132

Class

SystemMenuBlock
Provides a generic Menu block.

Namespace

Drupal\system\Plugin\Block

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.