friends_reject_friendship( int $friendship_id )

Mark a friendship request as rejected.


Parameters Parameters

$friendship_id

(int) (Required) ID of the pending friendship object.


Top ↑

Return Return

(bool) True on success, false on failure.


Source Source

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

function friends_reject_friendship( $friendship_id ) {
	$friendship = new BP_Friends_Friendship( $friendship_id, true, false );

	if ( empty( $friendship->is_confirmed ) && BP_Friends_Friendship::reject( $friendship_id ) ) {

		/**
		 * Fires after a friendship request is rejected.
		 *
		 * @since 1.0.0
		 *
		 * @param int                   $friendship_id ID of the pending friendship.
		 * @param BP_Friends_Friendship $friendships Friendship object. Passed by reference.
		 */
		do_action_ref_array( 'friends_friendship_rejected', array( $friendship_id, &$friendship ) );
		return true;
	}

	return false;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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