BP_Friends_Friendship::accept( int $friendship_id )

Mark a friendship as accepted.

Parameters Parameters


(int) (Required) ID of the friendship to be accepted.

Top ↑

Return Return

(int) Number of database rows updated.

Source 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() ) );

Top ↑

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.