Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 24,026
- How-to & Troubleshooting
- 129,662
- Creating & Extending
- 25,794
- Requests & Feedback
- 9,497
- Third Party Plugins
- 9,793
- Showcase
- 3,316
- Ideas
- 1,374
- Miscellaneous
- 9,182
-
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.