You are here

public static function VideoEmbedWidget::process in Video 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/VideoEmbedWidget.php \Drupal\video\Plugin\Field\FieldWidget\VideoEmbedWidget::process()

Form API callback: Processes a file_generic field element.

Expands the file_generic type to include the description and display fields.

This method is assigned as a #process callback in formElement() method.

Overrides FileWidget::process

File

src/Plugin/Field/FieldWidget/VideoEmbedWidget.php, line 328

Class

VideoEmbedWidget
Plugin implementation of the 'video_embed' widget.

Namespace

Drupal\video\Plugin\Field\FieldWidget

Code

public static function process($element, FormStateInterface $form_state, $form) {
  $element = parent::process($element, $form_state, $form);
  $item = $element['#value'];
  $element['data']['#value'] = $item['data'];
  $element['data']['#type'] = 'hidden';
  return $element;
}