1 field_test.module field_test_field_widget_form_alter(&$element, &$form_state, $context)

Implements hook_field_widget_form_alter().

File

core/modules/field/tests/field_test/field_test.module, line 237
Helper module for the Field API tests.

Code

function field_test_field_widget_form_alter(&$element, &$form_state, $context) {
  switch ($context['field']['field_name']) {
    case 'alter_test_text':
      backdrop_set_message('Field size: ' . $context['instance']['widget']['settings']['size']);
      break;

    case 'alter_test_options':
      backdrop_set_message('Widget type: ' . $context['instance']['widget']['type']);
      break;
  }
}