Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show content if invites are enabled (for groups)

  • @billzy

    Participant

    Hi,

    I am looking for a small snippet of code that will allow me to display a link in my theme on the condition that invites are enabled for that user of a group?

    My last attempts was something like

    if(bp_group_has_invites ()){
    content
    }

    Any reason why this would not be working?

    Many Thanks,

    Billy

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

    Keymaster

    bp_group_has_invites() starts the entire template loop. You don’t want that if you’re after a simple ‘are invites enabled for this group’ check.

    Use bp_groups_user_can_send_invites(). It defaults to the current logged in user, so also check is_user_logged_in().

    @billzy

    Participant

    Hey Paul,

    Thank you very much for your prompt reply, that snippet worked a treat … =)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show content if invites are enabled (for groups)’ is closed to new replies.
Skip to toolbar