Helping you Build Your Own Social Network!

Faster, better and easier!

Get the User's Full Name using user_id

(2 posts) (1 voice)
  • Started 1 year ago by crashutah
  • Latest reply from crashutah

Tags:

No tags yet.


  1. I’m trying to find an easy way to get the name for a user from a user_id. 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. All I have is the user_id of the 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? Or possibly a way to always keep the display_name in WordPress synched with the name in BP?

    Posted 1 year ago #
  2. Nevermind. I got it: bp_core_get_user_displayname( $userid )

    Posted 1 year ago #

Reply

You must log in to post.