Skip to:
Content
Pages
Categories
Search
Top
Bottom

Check Which Role User Has Using PHP


  • emrphy
    Participant

    @emrphy

    How can I check what role the user has using PHP? I want the index page of my forums to say one thing if the users are of a certain role, and another if they are of another role (a prompt to upgrade their account to see the rest of the forums). How would I do this?

Viewing 1 replies (of 1 total)

  • tharsheblows
    Participant

    @tharsheblows

    You can get the displayed user role (eg “Participant”, “Keymaster” etc) of the current user using bbp_get_user_display_role( get_current_user_id() ) although you’d need to check if they were logged in first. The template to modify is content-archive-forum.php.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar