bp_stop_following( array $args = '' )

Stop following a user’s activity.

Description

Parameters

$args

(Optional) Array of arguments.

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

Default value: ''

Return

(bool)

Source

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

function bp_stop_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'] );

	if ( empty( $follow->id ) || ! $follow->delete() ) {
		return false;
	}

	/**
	 * @todo add title/description
	 *
	 * @since BuddyBoss 1.0.0
	 */
	do_action_ref_array( 'bp_stop_following', array( &$follow ) );

	return true;
}

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.