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

4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
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.