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

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

Description

Parameters

$friendship_id

(Required) The unique ID of the friendship.

$initiator_user_id

(Required) The friendship initiator user ID.

$friend_user_id

(Required) The friendship request receiver user ID.

Source

File: bp-friends/bp-friends-notifications.php

function bp_friends_friendship_requested_notification( $friendship_id, $initiator_user_id, $friend_user_id ) {
	bp_notifications_add_notification( array(
		'user_id'           => $friend_user_id,
		'item_id'           => $initiator_user_id,
		'secondary_item_id' => $friendship_id,
		'component_name'    => buddypress()->friends->id,
		'component_action'  => 'friendship_request',
		'date_notified'     => bp_core_current_time(),
		'is_new'            => 1,
	) );
}

Changelog

Changelog
Version Description
BuddyPress 1.9.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.