You are here

public static function ImageWidgetHelper::alter in Lightning Media 8.2

Same name and namespace in other branches
  1. 8.4 src/ImageWidgetHelper.php \Drupal\lightning_media\ImageWidgetHelper::alter()
  2. 8 src/ImageWidgetHelper.php \Drupal\lightning_media\ImageWidgetHelper::alter()
  3. 8.3 src/ImageWidgetHelper.php \Drupal\lightning_media\ImageWidgetHelper::alter()

Alters an image widget form element.

Parameters

array $element: The widget form element.

\Drupal\image\Plugin\Field\FieldWidget\ImageWidget $widget: The widget plugin.

1 call to ImageWidgetHelper::alter()
lightning_media_field_widget_form_alter in ./lightning_media.module
Implements hook_field_widget_form_alter().

File

src/ImageWidgetHelper.php, line 94

Class

ImageWidgetHelper
Contains helper functions for manipulating image field widgets.

Namespace

Drupal\lightning_media

Code

public static function alter(array &$element, ImageWidget $widget) {

  // Store the widget settings where process() can see them.
  $element['#settings'] = static::getSettings($widget);
  $element['#process'][] = [
    static::class,
    'process',
  ];
}