function field_widget_field
Retrieves the field definition for a widget's helper callbacks.
Widgets helper element callbacks (such as #process, #element_validate, #value_callback, ...) should use field_widget_field() and field_widget_instance() instead of field_info_field() and field_info_instance() when they need to access field or instance properties. See hook_field_widget_form() for more details.
Parameters
$element: The structured array for the widget.
$form_state: The form state.
Return value
The $field definition array for the current widget.
See also
4 calls to field_widget_field()
- file_field_widget_process in modules/file/ file.field.inc 
- An element #process callback for the file_generic field type.
- file_field_widget_value in modules/file/ file.field.inc 
- The #value_callback for the file_generic field element.
- number_field_widget_validate in modules/field/ modules/ number/ number.module 
- FAPI validation of an individual number element.
- taxonomy_autocomplete_validate in modules/taxonomy/ taxonomy.module 
- Form element validate handler for taxonomy term autocomplete element.
File
- 
              modules/field/ field.form.inc, line 587 
Code
function field_widget_field($element, $form_state) {
  $field_state = field_form_get_state($element['#field_parents'], $element['#field_name'], $element['#language'], $form_state);
  return $field_state['field'];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
