Support » Plugin: Asgaros Forum » Get user role

  • Resolved Aaron Reimann

    (@areimann)


    I’m trying to get the current Asgaros role. In WP, I can do this:

    $user_meta = get_userdata( get_current_user_id() );
    var_dump( $user_roles=$user_meta->roles );
    

    And I get a user’s WP role.

    Can you give me the code to get the Asgaros roles to the active user?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello @areimann

    Please try the following:

    $role = AsgarosForumPermissions::getForumRole(123);

    123 is the ID of an user.

    Thanks for getting back to me. I appreciate it.

    I think I asked for the wrong thing. I’m looking for a list of Custom User Groups for the current logged in user.

    I found what I was looking for:

    	$user_id = get_current_user_id();
    	$role = AsgarosForumUserGroups::getUserGroupsOfUser ( $user_id );
    

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get user role’ is closed to new replies.