You are here

function select2_field_widget_entityreference_autocomplete_form_alter in Select 2 7

File

./select2.module, line 622
Main file for Select2 module.

Code

function select2_field_widget_entityreference_autocomplete_form_alter(&$element, &$form_state, $context) {
  select2_field_widget_entityreference_autocomplete_base_form_alter($element, $form_state, $context);
  $element['target_id']['#select2_defaults']['multiple'] = FALSE;
  $element['target_id']['#select2_defaults']['initSelection'] = 'entityReferenceInitSelecttion';
}