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

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

Description

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

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 feeds 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
	) );
}

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.