You are here

public static function EntitySubmenuBlock::processFieldSets in Entity Submenu Block 8

Form API callback: Processes the elements in field sets.

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

File

src/Plugin/Block/EntitySubmenuBlock.php, line 135

Class

EntitySubmenuBlock
Provides an Entity Submenu Block.

Namespace

Drupal\entity_submenu_block\Plugin\Block

Code

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