You are here

function content_taxonomy_autocomplete_field_widget_info_alter in Content Taxonomy 7

Implements hook_field_widget_info_alter().

File

./content_taxonomy_autocomplete.module, line 6

Code

function content_taxonomy_autocomplete_field_widget_info_alter(&$info) {

  // Add a setting for validating new terms.
  $ct_settings = array(
    'content_taxonomy_autocomplete_new_terms' => 'allow',
  );
  $info['taxonomy_autocomplete']['settings'] += $ct_settings;

  // Add this to the Active Tags as well, if enabled.
  if (isset($info['active_tags']['settings'])) {
    $info['active_tags']['settings'] += $ct_settings;
  }

  // Add this to the autocomplete deluxe as well, if enabled.
  if (isset($info['autocomplete_deluxe_taxonomy']['settings'])) {
    $info['autocomplete_deluxe_taxonomy']['settings'] += $ct_settings;
  }

  // Add this to the entityreference autocomplete as well, if enabled.
  if (isset($info['entityreference_autocomplete']['settings'])) {
    $info['entityreference_autocomplete']['settings'] += $ct_settings;
  }

  // Add this to the entityreference autocomplete (tags) as well, if enabled.
  if (isset($info['entityreference_autocomplete_tags']['settings'])) {
    $info['entityreference_autocomplete_tags']['settings'] += $ct_settings;
  }
}