Skip to content

Instantly share code, notes, and snippets.

@drnikko
Created June 5, 2012 21:21
Show Gist options
  • Save drnikko/2878067 to your computer and use it in GitHub Desktop.
Save drnikko/2878067 to your computer and use it in GitHub Desktop.
if ($acct = user_load_by_name('admin')) {
echo "loaded user";
// this loads the user's profile 2 data, of the profile2
if ($profiletwo = profile2_load_by_user($acct->uid, 'part_1')) {
// and this returns just the term id of what they selected
print_r($profiletwo->field_part1_skills);
}
else {
echo "cannot load profile";
}
}
else {
echo "cannot load user";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment