WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to get role of user (3 posts)

  1. frank thirteen
    Member
    Posted 1 year ago #

    I need to get the role associated with a user -- not the "currently logged in user".

    I am using Buddypress (not that should matter to the nature of this question) and I am in the bp_members() loop.

    How can I retrieve the role of the user I am reporting on in the loop at any given time?

    Thanks.

  2. rachelbaker
    Member
    Posted 1 year ago #

    I am sure there are other ways to do this, but one that I know of is to pass the $userid of the member to the get_userdata() method.

    Example code here: https://gist.github.com/3138658

  3. frank thirteen
    Member
    Posted 1 year ago #

    Thanks @rachelbaker

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags