You are here

function location_user_user_load in Location 7.4

Same name and namespace in other branches
  1. 7.3 location_user.module \location_user_user_load()

Implement hook_user_load().

File

./location_user.module, line 57
Associate locations with users.

Code

function location_user_user_load($users) {
  foreach ($users as $k => $v) {
    $users[$k]->locations = location_load_locations($users[$k]->uid, 'uid');
    $users[$k]->location = count($users[$k]->locations) ? $users[$k]->locations[0] : array();
  }
}