You are here

public static function EntityReferenceBrowserWidget::processEntityBrowser in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php \Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget::processEntityBrowser()

Render API callback: Processes the entity browser element.

File

src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php, line 461

Class

EntityReferenceBrowserWidget
Plugin implementation of the 'entity_reference' widget for entity browser.

Namespace

Drupal\entity_browser\Plugin\Field\FieldWidget

Code

public static function processEntityBrowser(&$element, FormStateInterface $form_state, &$complete_form) {
  $uuid = key($element['#attached']['drupalSettings']['entity_browser']);
  $element['#attached']['drupalSettings']['entity_browser'][$uuid]['selector'] = '#' . $element['#custom_hidden_id'];
  return $element;
}