You are here

function field_test_field_widget_form_alter in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/field/tests/modules/field_test/field_test.module \field_test_field_widget_form_alter()

Implements hook_field_widget_form_alter().

File

modules/field/tests/field_test.module, line 252

Code

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