WordPress.org

Ready to get started?Download WordPress

Forums

Check a Role? (4 posts)

  1. marke1
    Member
    Posted 8 years ago #

    How can I check what role user has? Not capabilities, but the role itself. For example, I want to check if a person is a "Subscriber"

  2. Lester Chan
    Member
    Posted 8 years ago #

    Try:
    $current_user->roles

    Tested and works.

  3. Phunky
    Member
    Posted 8 years ago #

    Ooooh dint know about that GamerZ :D

    Anyway i made a function, well a few functions for getting any user's role just by there $user_ID

    http://pastecode.net/?action=viewpost&tag=715

    ^ thats cut down from what ive written as its been done for a very modded WP2.01 site but you should be able to work it out from that!

  4. marke1
    Member
    Posted 8 years ago #

    thanks, that does it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags