What are the steps to create a custom widget based on taxonomy_select? I need to create a widget for fields of type "taxonomy_term_reference". The widget "taxonomy_select" is very nearly what I need to build, but needs some modification. I have seen examples that start with a given widget to build a custom version. The function below fails because there is no "taxonomy_select_field_widget_form" defined. Where is the "taxonomy_select" form creation code?

/**
 * Implements hook_field_widget_form().
 */
function taxonomy_multiselect_add_field_widget_form(&amp;$form, &amp;$form_state, $field, $instance, $langcode, $items, $delta, $element) {

  $element += taxonomy_select_field_widget_form($form, $form_state, $field, $instance, $langcode, $items, $delta, $element);

  return $element;
}
The taxonomy_term_reference field type uses the core options_select widget and implements hook_options_list() to provide the values, the taxonomy module doesn't implement any of the widget code itself.

The options_select widget is defined in options_field_widget_info() in the code options.module file (inside the field module folder). The form elements themselves are built up in options_field_widget_form() in the same file. They're pretty well commented so you should be able to get a good idea of how they work.

I'd also recommend the Examples module if you haven't already got it, it has a field type/widget example module with good sample code and comments.