How to get username / display name in Buddypress?

In the default tempalte settings for buddypress, the name of the user who posted the specific activity is displayed as follows: bp_activity_action(); But this brings much more than just the username. Is there an easier way to get an object / username?

The Wordpess get userdata function does not work, because it displays the author of the page, and not the name of the author of the comment or activity.

+5
source share
3 answers

You have a name mapping function below:

bp_get_displayed_user_fullname()

OR

Display username:

bp_core_get_username($user_id)
+7
source

Display name for registered user:

echo bp_core_get_user_displayname( bp_loggedin_user_id() );
+3
source

bp_activity_user_link()?

0

All Articles