bp_is_following( array $args = '' )

Check if a user is already following another user.

Description

Parameters

$args

(array) (Optional) Array of arguments.

  • 'leader_id'
    (int) The user ID of the person we want to check.
  • 'follower_id'
    (int) The user ID initiating the follow request.

Default value: ''

Return

(bool)

Source

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

function bp_is_following( $args = '' ) {

	$r = wp_parse_args( $args, array(
		'leader_id'   => bp_displayed_user_id(),
		'follower_id' => bp_loggedin_user_id()
	) );

	$follow = new BP_Activity_Follow( $r['leader_id'], $r['follower_id'] );

	return apply_filters( 'bp_is_following', (int)$follow->id, $follow );
}

Changelog

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