function field_test_field_widget_properties_user_alter

Implements hook_field_widget_properties_ENTITY_TYPE_alter().

File

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

Code

function field_test_field_widget_properties_user_alter(&$widget, $context) {
    // Always use buttons for the alter_test_options field on user forms.
    if ($context['field']['field_name'] == 'alter_test_options') {
        $widget['type'] = 'options_buttons';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.