Search Results for 'display user role on profile page'
-
Search Results
-
First off, I’ve just installed Justin Tadock’s Members Plugin to get access to the Restrict Roles Template tags. What I’d like to do is make it so that specific components of my BP install are only available to certain roles.
This is the code I’ve come up with so far:
if ( bp_is_active( ‘profile’ | ‘activity’ | ‘messages’ | ‘friends’ | ‘groups’ | ‘settings’ ) && function_exists( ‘current_user_has_role’ ) && current_user_has_role( ‘subscriber’ | ‘moderator’ | ‘administrator’ ) ) {
// the BP Component is “Profile, Activity, Messages, Friends, Groups, or Settings”, and the users role is “Subscriber, Moderator, or Administrator”display the component; // I don’t know what to put here so that the component is displayed if the user has the right role.
}else {
wp_redirect(get_option(‘siteurl’) . ‘/page-of-my-choice.php’);; // redirects user who don’t have the correct role to my page of my choice
}Any Ideas on how to make this work?
I needed certain BuddyPress members to have specific member levels, such as bronze, silver, and gold. To create these new user roles, I installed Justin Tadlock’s Members plugin: http://justintadlock.com/archives/2009/09/17/members-wordpress-plugin
How would I go about displaying the user role on each user’s public profile page, such as under their name (and above their status)? I’m more of an xhtml/css person rather than PHP, so I’m a bit lost. I’ve read the WordPress support topic for how to display certain icons based on user role, but it didn’t help much: http://wordpress.org/support/topic/313901
It doesn’t seem like a super complicated thing, but I have yet to find any real documentation on it with BuddyPress. Any help would be greatly appreciated. Thanks!
Topic: Group Types & Roles