bp_friends_friendship_accepted_activity( int $friendship_id, int $initiator_user_id, int $friend_user_id, object|bool $friendship = false )

Add activity stream items when one members accepts another members request for virtual friendship.


Parameters Parameters

$friendship_id

(int) (Required) ID of the friendship.

$initiator_user_id

(int) (Required) ID of friendship initiator.

$friend_user_id

(int) (Required) ID of user whose friendship is requested.

$friendship

(object|bool) (Optional) Friendship object.

Default value: false


Source Source

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

function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) {
	if ( ! bp_is_active( 'activity' ) ) {
		return;
	}

	// Record in activity streams for the initiator.
	friends_record_activity( array(
		'user_id'           => $initiator_user_id,
		'type'              => 'friendship_created',
		'item_id'           => $friendship_id,
		'secondary_item_id' => $friend_user_id
	) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.