Skip to:
Content
Pages
Categories
Search
Top
Bottom

Template Tag “is_user_in_group()” ???

  • Avatar of Nepf
    nepf
    Participant

    @nepf

    I’m creating a new theme.
    I want to display something in the sidebar only to members of a certain group.

    Is there a template tag, something like “is_user_in_group(‘cats’)” ???

Viewing 3 replies - 1 through 3 (of 3 total)
  • `
    function groups_is_user_member( $user_id, $group_id )
    `

    Avatar of Nepf
    nepf
    Participant

    @nepf

    thank you

    Avatar of techguy
    techguy
    Participant

    @crashutah

    Since you saved me the time looking for this, I’ll throw in the other 2 I already knew:
    groups_is_user_mod( $bp->loggedin_user->id, $bp->groups->current_group->id)
    groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id)

    Plus, that’s the code to get the logged in userid and current groupid.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.