bp_has_friends_to_invite( object|bool $group = false )

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


Parameters Parameters

$group

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

Default value: false


Top ↑

Return Return

(bool)


Source 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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.