Hi @reinaldudras,
user_can()
is the function you need. For example:
if ( user_can( bp_get_member_user_id(), 'manage_sites' ) )
echo 'network administrator';
Note: Untested. There’s a slightly different method of getting the member’s ID depending on the exact context you need. I suspect bp_get_member_user_id()
will work.
Ref: https://codex.wordpress.org/Function_Reference/user_can
Hello @henrywright
Thank you for your response!
I read article about this topic, and said that I should put something inside my theme function.php file to show the label every user who have a “super user” role or something.. But unfortunately I forget where I read it.
Do u know what I need add?
I’ve no idea what you might have read but you can accomplish this via hooks. Specifically, the bp_profile_header_meta
could be what you need. Try adding this to your theme’s functions.php file:
function my_output_user_role_function() {
if ( user_can( bp_get_member_user_id(), 'manage_sites' ) )
echo 'Role: network administrator';
}
add_action( 'bp_profile_header_meta', 'my_output_user_role_function' );
Note: You can change the text Role: network administrator to whatever you like.
Hi again!
These pictures https://www.dropbox.com/s/jkkoh09efqvr901/directory.jpg?dl=0 and https://www.dropbox.com/s/hgy054419sgij3t/profile.jpg?dl=0 shows what I need.
I mean this labels can show in members directory and profile under the nickname/username output (member-loop section) and this label can be displayed only for admins and moderators
Does it makes sense?:)
You’ll need to modify the templates to achieve that.
I see but I dont know exactly what I need to add inside this files.. :/
See my first post in this thread. That should do it for you.