Skip to content
This repository was archived by the owner on Nov 9, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions govcms.profile
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,17 @@ function govcms_field_widget_form_alter(&$element, FormStateInterface $form_stat
// $context['widget']->getPluginId().
\Drupal::theme()->alter(['field_widget_form'], $element, $form_state, $context);
}

/**
* Implements hook_field_widget_multivalue_form_alter().
*/
function govcms_field_widget_multivalue_form_alter(&$elements, FormStateInterface $form_state, $context) {
// In Drupal 7 `hook_field_widget_multivalue_form_alter` could be implemented
// by the theme, but in Drupal 8 this hook changed to being module-only.
// This hook can be critical for improving the editor experience for things
// like paragraphs. Implementing themes can access the plugin ID via
// $context['widget']->getPluginId().
\Drupal::theme()->alter([
'field_widget_multivalue_form',
], $elements, $form_state, $context);
}