You are here

private function ContentTaxonomyAutocompleteModeratedTermsSearchAPIProcessor::fieldValueIsModerated in Content Taxonomy 7

Returns TRUE if the given term id is from moderated vocabulary.

Parameters

$value: The term id.

$field: The according field API field.

1 call to ContentTaxonomyAutocompleteModeratedTermsSearchAPIProcessor::fieldValueIsModerated()
ContentTaxonomyAutocompleteModeratedTermsSearchAPIProcessor::processTaxonomyField in includes/content_taxonomy_autocomplete_moderated_terms.inc
Processes a single field on a single item and does the actual filtering.

File

includes/content_taxonomy_autocomplete_moderated_terms.inc, line 71

Class

ContentTaxonomyAutocompleteModeratedTermsSearchAPIProcessor
Search API Processor that filters out terms from moderated vocabularies.

Code

private function fieldValueIsModerated($value, $field) {
  $allowed_voc = $field['settings']['allowed_values'][0]['vocabulary'];
  $term = taxonomy_term_load($value);
  if ($term && $term->vocabulary_machine_name == $allowed_voc) {
    return FALSE;
  }
  return TRUE;
}