• Resolved Paul

    (@pawelszroeder)


    Hi! I’ve selected option in default profile to show user role. It shows ok for Subscriber, but for Administrator it shows empty space.
    How to show user role also for administrator?

    • This topic was modified 3 years, 1 month ago by Paul.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @pawelszroeder

    Are you using the role field in the Profile form to display the selected role?

    Regards,

    Thread Starter Paul

    (@pawelszroeder)

    Yes, but one more info – user admin was created before install Ultimate member plugin (with WP install).

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @pawelszroeder

    Since the administrator role isn’t created via UM User Roles, it won’t display it in the profile view. You can try the following code snippet to use the shortcode [um_display_role] for the Profile form to display any roles:

    add_shortcode("um_display_role", function(){
        if( function_exists("um_fetch_user") ){
            um_fetch_user( um_profile_id() );
            return UM()->roles()->get_role_name( um_user("role") );
        }
    });

    You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    Regards,

    Thread Starter Paul

    (@pawelszroeder)

    Ok I get it, thanks

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Thanks for letting us know.

    Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show user role in profile’ is closed to new replies.