friends_friendship_accepted

Fires after a friendship is accepted.

Description

do_action( 'friends_friendship_accepted', (int) $friendship_id, (int) $friendship_initiator_user_id, (int) $friendship_friend_user_id, (object) $friendship ); 

Parameters (4)

0. $friendship_id (int)
ID of the pending friendship object.
1. $friendship_initiator_user_id (int)
The friendship initiator user id.
2. $friendship_friend_user_id (int)
ID of the user requested friendship with.
3. $friendship (object)
BuddyPress Friendship Object.

Usage

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

Defined (1)

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

/bp-friends/bp-friends-functions.php  
  1. do_action( 'friends_friendship_accepted', $friendship->id, $friendship->initiator_user_id, $friendship->friend_user_id, $friendship );