You are here

function content_taxonomy_autocomplete_widget in Content Taxonomy 6

Same name and namespace in other branches
  1. 5 content_taxonomy_autocomplete.module \content_taxonomy_autocomplete_widget()
  2. 6.2 content_taxonomy_autocomplete.module \content_taxonomy_autocomplete_widget()

Implementation of hook_widget().

File

./content_taxonomy_autocomplete.module, line 135
Defines a widget type for content_taxonomy with autocomplete

Code

function content_taxonomy_autocomplete_widget(&$form, &$form_state, $field, $items, $delta = NULL) {
  $element = array(
    '#type' => 'content_taxonomy_autocomplete',
    '#default_value' => isset($items) ? $items : NULL,
    '#value_callback' => 'content_taxonomy_autocomplete_value',
    '#vid' => $field['vid'],
  );
  return $element;
}