Getting User’s Full Name from user_id
I’m trying to find an easy way to get the name for a user without having to scroll through all the xprofile fields. This is easy if the user is logged in ($bp->loggedin_user->fullname), but in this case I want to get the name of a different user to that I can display it for the logged in user.
I could use the WordPress functions to get the display_name:
$user_info = get_userdata($referring_user_id);
$referring_user = $user_info->display_name;
But the display_name is just the username and not the value in the name field.
Any ideas on how to get this?
You must be logged in to reply to this topic.