I have a location field for a user that is created via the Content Profile module.
How can I access that field in code for the logged in user? Is it something like $user->content_profile['location']
I can't seem to grab this info.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
You'll have to load the content profile node into a variable first using
This should work:
$user_profile = content_profile_load('profile', $user->uid);
That will return an object ($user_profile) that you can call the fields which you've set up. Use
to see which fields are available.