You are here

function party_hat_facetapi_facet_info_alter in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_hat/party_hat.module \party_hat_facetapi_facet_info_alter()

Implements hook_facetapi_facet_info_alter().

Change hat_reference fields to use a diferent value callback.

See also

search_api_facetapi_facetapi_facet_info_alter

File

modules/party_hat/party_hat.module, line 788
party_hat.module Provides an extensible access system for parties.

Code

function party_hat_facetapi_facet_info_alter(&$facets, $search) {

  // Change the value callback for the party_hat property.
  foreach ($facets as &$facet) {

    // Only interested in party hat properties.
    if ($facet['field type'] != 'party_hat') {
      continue;
    }
    $facet['map options']['value callback'] = '_party_hat_facet_create_label';
    break;
  }
}