function layout_builder_entity_form_display_alter in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module \layout_builder_entity_form_display_alter()
- 9 core/modules/layout_builder/tests/modules/layout_builder_test/layout_builder_test.module \layout_builder_entity_form_display_alter()
Implements hook_entity_form_display_alter().
File
- core/
modules/ layout_builder/ tests/ modules/ layout_builder_test/ layout_builder_test.module, line 103 - Provides hook implementations for Layout Builder tests.
Code
function layout_builder_entity_form_display_alter(EntityFormDisplayInterface $form_display, array $context) {
if ($context['form_mode'] === 'layout_builder') {
$form_display
->setComponent('status', [
'type' => 'boolean_checkbox',
'settings' => [
'display_label' => TRUE,
],
]);
}
}