5

In buddypress default tempalte, username who has posted a certain activity is displayed like this: bp_activity_action(); But that brings much more than just the username. Is there a simpler way to get the user object/name ?

Wordpess get userdata function doesn't work, as it displays the page author, not the comment or activity author name.

pyronaur
  • 3,515
  • 6
  • 35
  • 52

3 Answers3

7

You have Display name use below function:

bp_get_displayed_user_fullname()

OR

Display User Name:

bp_core_get_username($user_id)
Chirag Patel
  • 516
  • 4
  • 14
3

Display name for logged in user:

echo bp_core_get_user_displayname( bp_loggedin_user_id() );
Ünsal Korkmaz
  • 224
  • 4
  • 17
0

What about using bp_activity_user_link() ?

Ben Poulson
  • 3,368
  • 2
  • 17
  • 26
  • Okay, that's closer. Should I parse the URL I get and the try to get the username out of it ? Because it returns only an URL string, I need the name. – pyronaur Jun 14 '12 at 16:33