Filter taxonomy terms in autocomplete list by boolean field on vocabulary's terms?
Here is how I've added a new term custom widget: 

/**
 * Implements hook_field_widget_info().
 */
function deepestlevel_taxonomy_widget_field_widget_info() {

  return array(
    'textfield' =&gt; array(
      'label' =&gt; t('deepestlevel_taxonomy_widget - Only deepest level'),
      'field types' =&gt; array('taxonomy_term_reference'),
      'settings' =&gt; array(
        'size' =&gt; 60,
        'autocomplete_path' =&gt; 'deepestlevel_taxonomy_widget/autocomplete',
      ),
      'behaviors' =&gt; array(
        'multiple values' =&gt; FIELD_BEHAVIOR_CUSTOM,
      ),
    ),
  );
}

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

  $tags = array();
  foreach ($items as $item) {
    $tags[$item['tid']] = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['tid']);
  }

  $element += array(
    '#type' =&gt; 'textfield',
    '#default_value' =&gt; taxonomy_implode_tags($tags),
    '#autocomplete_path' =&gt; 'deepestlevel_taxonomy_widget/autocomplete'. '/' . $field['field_name'],
    // '#autocomplete_path' =&gt; $instance['widget']['settings']['autocomplete_path'] . '/' . $field['field_name'],
    '#size' =&gt; $instance['widget']['settings']['size'],
    '#maxlength' =&gt; 1024,
    '#element_validate' =&gt; array('taxonomy_autocomplete_validate'),
  );

  return $element;
}

/**
 * Implements hook_menu().
 */
function deepestlevel_taxonomy_widget_menu() {
  $items['deepestlevel_taxonomy_widget/autocomplete'] = array(
    'title' =&gt; 'Autocomplete taxonomy deepest level',
    'page callback' =&gt; 'deepestlevel_taxonomy_widget',
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );
  return $items;
}

// THIS IS THE OVERRIDE CALLBACK copied from core taxonomy.pages.inc
// function taxonomy_autocomplete($field_name, $tags_typed = '') {
function deepestlevel_taxonomy_widget($field_name, $tags_typed = '') {

// NEW CODE HERE

}