function content_moderation_entity_form_display_alter

Same name in other branches
  1. 9 core/modules/content_moderation/content_moderation.module \content_moderation_entity_form_display_alter()
  2. 8.9.x core/modules/content_moderation/content_moderation.module \content_moderation_entity_form_display_alter()
  3. 11.x core/modules/content_moderation/content_moderation.module \content_moderation_entity_form_display_alter()

Implements hook_entity_form_display_alter().

File

core/modules/content_moderation/content_moderation.module, line 198

Code

function content_moderation_entity_form_display_alter(EntityFormDisplayInterface $form_display, array $context) {
    if ($context['form_mode'] === 'layout_builder') {
        $form_display->setComponent('moderation_state', [
            'type' => 'moderation_state_default',
            'weight' => -900,
            'settings' => [],
        ]);
    }
}

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