Skip to content

Instantly share code, notes, and snippets.

@heddn
Created March 29, 2013 17:05
Show Gist options
  • Select an option

  • Save heddn/5272136 to your computer and use it in GitHub Desktop.

Select an option

Save heddn/5272136 to your computer and use it in GitHub Desktop.
hook_facetapi_hash_alter()
function example_facetapi_hash_alter(&$hash, $delta) {
preg_match('/(.+@)(.+?)(:.+)/', $delta, $matches);
$delta = $matches[1] . EXAMPLE_SEARCHER_ID . $matches[3];
$hash = substr(drupal_hash_base64($delta), 0, 32);
$hash = strtr($hash, array('-' => '0', '_' => '1'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment