bp_group_has_invites( string $args = '' )
Whether or not there are invites.
Description
Parameters
- $args
-
(Optional)
Default value: ''
Return
(bool|mixed|void)
Source
File: bp-groups/bp-groups-template.php
6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 | 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 ( ! empty ( 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 BuddyPress 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
Version | Description |
---|---|
BuddyPress 1.1.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.