1 field_test.module field_test_field_widget_properties_alter(&$widget, $context)

Implements hook_field_widget_properties_alter().

File

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

Code

function field_test_field_widget_properties_alter(&$widget, $context) {
  // Make the alter_test_text field 42 characters for nodes and comments.
  if (in_array($context['entity_type'], array('node', 'comment')) && ($context['field']['field_name'] == 'alter_test_text')) {
    $widget['settings']['size'] = 42;
  }
}