Field Widget API

Define Field API widget types.

Field API widgets specify how fields are displayed in edit forms. Fields of a given field type may be edited using more than one widget. In this case, the Field UI module allows the site builder to choose which widget to use. Widget types are defined by implementing hook_field_widget_info().

Widgets are Form API elements with additional processing capabilities. Widget hooks are typically called by the Field Attach API during the creation of the field form structure with field_attach_form().

See also

Field API

Field Types API

Field Formatter API

Functions & methods

NameLocationDescription
hook_field_widget_errormodules/field/field.api.phpFlag a field-level validation error.
hook_field_widget_formmodules/field/field.api.phpReturn the form for a single field widget.
hook_field_widget_form_altermodules/field/field.api.phpAlter forms for field widgets provided by other modules.
hook_field_widget_infomodules/field/field.api.phpExpose Field API widget types.
hook_field_widget_info_altermodules/field/field.api.phpPerform alterations on Field API widget types.
hook_field_widget_properties_altermodules/field/field.api.phpAlters the widget properties of a field instance before it gets displayed.
hook_field_widget_WIDGET_TYPE_form_altermodules/field/field.api.phpAlter widget forms for a specific widget provided by another module.

File

modules/field/field.api.php, line 682