bp_friends_get_invite_list

Filters the list of potential friends that can be invited to this group.

Description

apply_filters( 'bp_friends_get_invite_list', (array|bool) $friends, (int) $user_id, (int) $group_id ); 

Parameters (3)

0. $friends (array|bool)
Array friends available to invite or false for no friends.
1. $user_id (int)
ID of the user checked for who they can invite.
2. $group_id (int)
ID of the group being checked on.

Usage

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

Defined (1)

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

/bp-friends/bp-friends-functions.php  
  1. return apply_filters( 'bp_friends_get_invite_list', $friends, $user_id, $group_id );