Since Drupal 7.8, hook_field_widget_form_alter() and hook_field_widget_WIDGET_TYPE_form_alter() have allowed modules to alter widgets provided by other modules. For example, a taxonomy-related module can modify the widgets for core taxonomy fields to properly reflect validation restrictions it might add.
During the course of Drupal 8's refactoring of the Field API, these hooks lost the ability to modify the top level of multivalue widgets (so only the individual sub-items could be changed, not the widget overall).
To avoid disruption to existing code that might expect this behavior, we have added two new hooks for multivalue widgets, parallel to the existing hooks:
hook_field_widget_multivalue_form_alter()hook_field_widget_multivalue_WIDGET_TYPE_form_alter()
These hooks can be used in place of the existing hooks for multivalue widgets. To access individual child elements from within these hooks, loop over the $elements parameter using Drupal\Core\Render\Element::children($elements). In most cases, these hooks should be used in place of the previous ones.