Same name and namespace in other branches
  1. 8.9.x core/modules/layout_builder/layout_builder.module \layout_builder_form_entity_form_display_edit_form_alter()
  2. 9 core/modules/layout_builder/layout_builder.module \layout_builder_form_entity_form_display_edit_form_alter()

Implements hook_form_FORM_ID_alter() for \Drupal\field_ui\Form\EntityFormDisplayEditForm.

File

core/modules/layout_builder/layout_builder.module, line 92
Provides hook implementations for Layout Builder.

Code

function layout_builder_form_entity_form_display_edit_form_alter(&$form, FormStateInterface $form_state) {

  // Hides the Layout Builder field. It is rendered directly in
  // \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::buildMultiple().
  unset($form['fields'][OverridesSectionStorage::FIELD_NAME]);
  $key = array_search(OverridesSectionStorage::FIELD_NAME, $form['#fields']);
  if ($key !== FALSE) {
    unset($form['#fields'][$key]);
  }
}