Accessing location field programmatically in Drupal 7, via hosting entity object and wrapper I'm using Location module (particularly its Location CCK part) with Drupal 7. Added location field 'field_location' to User (as an example of hosting entity), and initialized location values for test users in user edit interface. However, I'm unable to access location data of the current user:

global $user;
$user_id = $user-&gt;uid;

$loc = $user-&gt;field_location;


or:

$wrapper = entity_metadata_wrapper('user', $user_id);
$loc = $wrapper-&gt;field_location;


The statements with $loc don't work for object and wrapper (while both user object and wrapper are initialized successfully). Same for:

$loc = $wrapper-&gt;field_location[0];
$loc = $wrapper-&gt;field_location-&gt;raw();


I've read a number of posts on this topic, however haven't found a workable solution, would appreciate insights on this.
For a custom field to be available to the wrapper, the module defining it needs to implement hook_entity_property_info() (or, which is new to me, by adding property metadata to the field using hook_field_info_alter()).

The location_cck module doesn't do that, but the bundled location_entity module does. 

If you enable that module you should be able to access the location field as you'd expect.