Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 24,005
- How-to & Troubleshooting
- 129,528
- Creating & Extending
- 25,790
- Requests & Feedback
- 9,496
- Third Party Plugins
- 9,783
- Showcase
- 3,316
- Ideas
- 1,397
- Miscellaneous
- 9,170
-
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.
See also: WordPress.org • bbPress.org • BuddyPress.org • Matt • Blog RSS