function FormHooks::ensureAdvancedSettings

Same name and namespace in other branches
  1. main core/themes/admin/src/Hook/FormHooks.php \Drupal\admin\Hook\FormHooks::ensureAdvancedSettings()

Ensure correct settings for advanced, meta and revision form elements.

Parameters

array $form: The form.

2 calls to FormHooks::ensureAdvancedSettings()
FormHooks::formNodeFormAlter in core/themes/admin/src/Hook/FormHooks.php
Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\Form\NodeForm.
FormHooks::stickyActionButtonsAndSidebar in core/themes/admin/src/Hook/FormHooks.php
Add some major form overrides.

File

core/themes/admin/src/Hook/FormHooks.php, line 862

Class

FormHooks
Provides form related hook implementations.

Namespace

Drupal\admin\Hook

Code

private function ensureAdvancedSettings(array &$form) : void {
  $form['advanced']['#type'] = 'container';
  $form['advanced']['#accordion'] = TRUE;
  $form['meta']['#type'] = 'container';
  $form['meta']['#access'] = TRUE;
  $form['revision_information']['#type'] = 'container';
  $form['revision_information']['#group'] = 'meta';
  $form['revision_information']['#attributes']['class'][] = 'entity-meta__revision';
}

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