bp_has_friends_to_invite( object|bool $group = false )

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

Description

Parameters

$group

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

Default value: false

Return

(bool)

Source

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

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.