bp_group_has_invites( string $args = '' )
Whether or not there are invites.
Description Description
Parameters Parameters
- $args
-
(Optional)
Default value: ''
Return Return
(bool|mixed|void)
Source Source
File: bp-groups/bp-groups-template.php
function bp_group_has_invites( $args = '' ) {
global $invites_template, $group_id;
$r = bp_parse_args( $args, array(
'group_id' => false,
'user_id' => bp_loggedin_user_id(),
'per_page' => false,
'page' => 1,
), 'group_has_invites' );
if ( empty( $r['group_id'] ) ) {
if ( groups_get_current_group() ) {
$r['group_id'] = bp_get_current_group_id();
} elseif ( isset( buddypress()->groups->new_group_id ) && buddypress()->groups->new_group_id ) {
$r['group_id'] = buddypress()->groups->new_group_id;
}
}
// Set the global (for use in BP_Groups_Invite_Template::the_invite()).
if ( empty( $group_id ) ) {
$group_id = $r['group_id'];
}
if ( ! $group_id ) {
return false;
}
$invites_template = new BP_Groups_Invite_Template( $r );
/**
* Filters whether or not a group invites query has invites to display.
*
* @since 1.1.0
*
* @param bool $value Whether there are requests to display.
* @param BP_Groups_Invite_Template $invites_template Object holding the invites query results.
*/
return apply_filters( 'bp_group_has_invites', $invites_template->has_invites(), $invites_template );
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.1.0 | Introduced. |