• Resolved ncapehorn

    (@ncapehorn)


    Hi there.
    Our client’s members will need to know who the admins are in case they need to raise an issue. Although I’ve enabled user roles to be displayed in the member directory, it’s only showing for people who are subscribers – for the admins it’s just blank. Do I need to change any visibility or privacy settings to allow admin user roles to be shown (for clarity – the user is visible, along with their photo, name and username, just not their role).

    Cheers!
    Nick

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @ncapehorn

    Sorry for the late answer. Try to use this hook:

    add_filter( 'um_members_after_user_name', 'um_md_um_members_after_user_name', 50, 2 );
    function um_md_um_members_after_user_name( $user_id, $directory_data ) {
    	$user_meta = get_userdata($user_id);
    	$user_roles = $user_meta->roles;
    	$user_roles = implode( ', ', $user_roles );
    
        echo $user_roles;
    }

    Thank you.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @ncapehorn

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Roles displayed in member directory’ is closed to new replies.