groups_membership_requested

Fires after the creation of a new membership request.

Description

do_action( 'groups_membership_requested', (int) $requesting_user_id, (array) $admins, (int) $group_id, (int) $requesting_user_id ); 

Parameters (4)

0. $requesting_user_id (int)
ID of the user requesting membership.
1. $admins (array)
Array of group admins.
2. $group_id (int)
ID of the group being requested to.
3. $requesting_user_id (int)
ID of the user requesting membership.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user_id ); 
The following example is for adding a hook callback.
  1. // define the groups_membership_requested callback 
  2. function action_groups_membership_requested( $requesting_user_id, $admins, $group_id, $requesting_user_id ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'groups_membership_requested', 'action_groups_membership_requested', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'groups_membership_requested', 'action_groups_membership_requested', 10, 4 ); 

Defined (1)

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

/bp-groups/bp-groups-functions.php  
  1. do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id );