um_user(‘role_name’) Doesn’t Work
-
In the previous version I could get the role slug. Now the code doesn’t return anything.
If I run this code I get a User ID and a User Name, but no role. How do I get the role?global $ultimatemember; $user_id = get_current_user_id(); um_fetch_user( $user_id ); $role = um_user('role_name'); $display_name = um_user('display_name'); ob_start( ); echo "<p>User ID: $user_id</p>\n"; echo "<p>User Name: $display_name</p>\n"; echo "<p>Role: $role</p>\n"; return ob_get_clean( );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘um_user(‘role_name’) Doesn’t Work’ is closed to new replies.