bp_has_friends_to_invite( object|bool $group = false )

Determine whether the current user has friends to invite to a group.

Description

Parameters

$group

(Optional) Group object. Default: current group in the loop.

Default value: false

Return

(bool)

Source

File: bp-groups/bp-groups-template.php

4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
function bp_has_friends_to_invite( $group = false ) {
    global $groups_template;
 
    if ( !bp_is_active( 'friends' ) ) {
        return false;
    }
 
    if ( empty( $group ) ) {
        $group =& $groups_template->group;
    }
 
    if ( !friends_check_user_has_friends( bp_loggedin_user_id() ) || !friends_count_invitable_friends( bp_loggedin_user_id(), $group->id ) ) {
        return false;
    }
 
    return true;
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.