BP_Friends_Friendship::accept( int $friendship_id )

Mark a friendship as accepted.

Description

Parameters

$friendship_id

(Required) ID of the friendship to be accepted.

Return

(int) Number of database rows updated.

Source

File: bp-friends/classes/class-bp-friends-friendship.php

	public static function accept($friendship_id) {
		global $wpdb;

		$bp = buddypress();

		return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->friends->table_name} SET is_confirmed = 1, date_created = %s WHERE id = %d AND friend_user_id = %d", bp_core_current_time(), $friendship_id, bp_loggedin_user_id() ) );
	}

Changelog

Changelog
Version Description
BuddyPress 1.0.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.