Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get User Role from ID

  • @robsward

    Participant

    I’m trying to add a column to bbPress 2.x that lists the last person to reply to a topic and adds a specific class to the

    if that person is a moderator or keymaster. Unfortunately, I can’t find any documentation on the template tags in 2.x. So far, I’ve been able to get the user ID for the last reply, but I can’t seem to find the function that would get the role information for that user based on their ID.
    Here’s the code that gets the ID:

    $reply_author_id = bbp_get_reply_author_id( array( 'post_id' => bbp_get_topic_last_active_id() ) );

    Now how can I get their bbPress role?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @robsward

    Participant

    Got a bit closer doing this:

    $reply_author_role = bbp_get_reply_author_role( array( 'post_id' => bbp_get_topic_last_active_id() ) );

    However, I want just the role to be returned without the enclosing div so I can use it in a conditional.

    @tkserver

    Participant

    $role = bbp_get_user_role( $reply_author_id );

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