• Hello WordPress community,

    I’m trying to display a logged in user’s ‘other roles’ when logged into my site. I’ve got custom roles that can be seen in the administrator backend (under “other roles” for a user). I’ve been able to sucessfully display a user’s primary role using

    <?php $user_info = get_userdata(1);
          echo 'You are a ' . implode(', ', $user_info->roles)."\n";
    ?>

    but can’t find a way to display their secondary ‘custom’ roles.

    Any help would be greatly appreciated!

  • The topic ‘displaying "other roles" when querying users roles’ is closed to new replies.