bp_friends_friendship_requested_notification

Notify one use that another user has requested their virtual friendship.

Description

bp_friends_friendship_requested_notification( (int) $friendship_id, (int) $initiator_user_id, (int) $friend_user_id ); 

Parameters (3)

0. $friendship_id (int)
The unique ID of the friendship.
1. $initiator_user_id (int)
The friendship initiator user ID.
2. $friend_user_id (int)
The friendship request receiver user ID.

Usage

  1. if ( !function_exists( 'bp_friends_friendship_requested_notification' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-friends/bp-friends-notifications.php'; 
  3.  
  4. // The unique ID of the friendship. 
  5. $friendship_id = -1; 
  6.  
  7. // The friendship initiator user ID. 
  8. $initiator_user_id = -1; 
  9.  
  10. // The friendship request receiver user ID. 
  11. $friend_user_id = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_friends_friendship_requested_notification($friendship_id, $initiator_user_id, $friend_user_id); 
  15.  

Defined (1)

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

/bp-friends/bp-friends-notifications.php  
  1. function bp_friends_friendship_requested_notification( $friendship_id, $initiator_user_id, $friend_user_id ) { 
  2. 'user_id' => $friend_user_id,  
  3. 'item_id' => $initiator_user_id,  
  4. 'secondary_item_id' => $friendship_id,  
  5. 'component_name' =>buddypress)->friends->id,  
  6. 'component_action' => 'friendship_request',  
  7. 'date_notified' => bp_core_current_time(),  
  8. 'is_new' => 1,  
  9. ) );