Skip to:
Content
Pages
Categories
Search
Top
Bottom

Template Tag “is_user_in_group()” ???

  • @nepf

    Participant

    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)
  • @nuprn1

    Participant

    `
    function groups_is_user_member( $user_id, $group_id )
    `

    @nepf

    Participant

    thank you

    @crashutah

    Participant

    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)
  • The topic ‘Template Tag “is_user_in_group()” ???’ is closed to new replies.
Skip to toolbar