📜  更改段落形式 drupal 8 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:29.507000             🧑  作者: Mango

代码示例1
/**  
 * Implements hook_field_widget_WIDGET_TYPE_form_alter().  
 */  
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';
  }
}