Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How do you display user roles in BuddyPress public profiles?


Xevo
Participant

@xevo

Make a plugin or put it in your functions.php.

function pc_get_userrole ($user_id) {
$user = new WP_User($user_id);
$userclean = $user->roles[0];
return $userclean;
}

Call it like this.

echo pc_get_userrole(bp_current_user_id());

Not sure how well it works, but it worked well enough for me.

Skip to toolbar