function paragraphs_test_field_widget_entity_reference_paragraphs_form_alter in Paragraphs 8
Implements hook_field_widget_WIDGET_TYPE_form_alter().
File
- tests/
modules/ paragraphs_test/ paragraphs_test.module, line 48 - Test module for testing the paragraphs module.
Code
function paragraphs_test_field_widget_entity_reference_paragraphs_form_alter(&$element, &$form_state, $context) {
if ($element['#paragraph_type'] == 'altered_paragraph') {
$element['subform']['field_text']['widget'][0]['#title'] = 'Altered title';
}
}