bp_groups_user_can_send_invites

Filters whether a user can send invites in a group.

Description

apply_filters( 'bp_groups_user_can_send_invites', (bool) $can_send_invites, (int) $group_id, (bool) $invite_status, (int) $user_id ); 

Parameters (4)

0. $can_send_invites (bool)
Whether the user can send invites
1. $group_id (int)
The group ID being checked
2. $invite_status (bool)
The group's current invite status
3. $user_id (int)
The user ID being checked

Usage

To run the hook, copy the example below.
  1. $can_send_invites = apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status, $user_id ); 
  2.  
  3. if ( !empty( $can_send_invites ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_groups_user_can_send_invites callback 
  2. function filter_bp_groups_user_can_send_invites( $can_send_invites, $group_id, $invite_status, $user_id ) { 
  3. // make filter magic happen here... 
  4. return $can_send_invites
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_groups_user_can_send_invites', 'filter_bp_groups_user_can_send_invites', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_groups_user_can_send_invites', 'filter_bp_groups_user_can_send_invites', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-groups/bp-groups-template.php  
  1. return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status, $user_id );