You are here

function languagefield_field_widget_form_alter in Custom Language field 7

Adds a callback function to widget.

Parameters

$element:

$form_state:

$context:

Only for language_field widgets, but not on the field settings form.

File

./languagefield.module, line 348
Provides a list of languages from ISO 639 standard. All variables of a $language-object can be found here: http://api.drupal.org/api/drupal/developer--globals.php/global/language

Code

function languagefield_field_widget_form_alter(&$element, &$form_state, $context) {
  if ($context['field']['type'] == 'language_field' && $form_state['build_info']['form_id'] != 'field_ui_field_edit_form') {
    $element['#value_callback'] = '_languagefield_widget_value';
  }
}