You are here

function facetapi_map_author in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.callbacks.inc \facetapi_map_author()
  2. 7.2 facetapi.callbacks.inc \facetapi_map_author()

Map callback for node authors.

1 string reference to 'facetapi_map_author'
facetapi_facetapi_facet_info in ./facetapi.facetapi.inc
Implements hook_facetapi_facet_info().

File

./facetapi.callbacks.inc, line 37
Callbacks referenced in hook implementations.

Code

function facetapi_map_author(array $values) {
  $map = array();
  $users = user_load_multiple($values);
  foreach ($users as $user) {
    $map[$user->uid] = format_username($user);
  }
  if (isset($map[0])) {
    $map[0] = variable_get('anonymous', t('Anonymous'));
  }
  return $map;
}