Friends::check( $args )

Check whether two users are friends.


Description Description

Top ↑

OPTIONS OPTIONS

: ID of the first user. Accepts either a user_login or a numeric ID.
: ID of the other user. Accepts either a user_login or a numeric ID.
## EXAMPLES
$ wp bp friend check 2161 65465 Success: Yes, they are friends.
$ wp bp friend see 2121 65456 Success: Yes, they are friends.


Source Source

File: cli/src/friends.php

	public function check( $args ) {
		$user   = $this->get_user_id_from_identifier( $args[0] );
		$friend = $this->get_user_id_from_identifier( $args[1] );

		if ( friends_check_friendship( $user->ID, $friend->ID ) ) {
			WP_CLI::success( 'Yes, they are friends.' );
		} else {
			WP_CLI::error( 'No, they are not friends.' );
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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