Forum Replies Created

Viewing 16 replies (of 16 total)
  • Thread Starter Qobalt

    (@qobalt)

    I think it’s here in /_inc/bp-follow-actions.php

    function bp_follow_action_start() {
    	global $bp;
    
    	if ( !bp_is_current_component( $bp->follow->followers->slug ) || !bp_is_current_action( 'start' ) )
    		return false;
    
    	if ( bp_displayed_user_id() == bp_loggedin_user_id() )
    		return false;
    
    	check_admin_referer( 'start_following' );
    
    	if ( bp_follow_is_following( array( 'leader_id' => bp_displayed_user_id(), 'follower_id' => bp_loggedin_user_id() ) ) )
    		bp_core_add_message( sprintf( __( 'You are already following %s.', 'bp-follow' ), bp_get_displayed_user_fullname() ), 'error' );
    	else {
    		if ( !bp_follow_start_following( array( 'leader_id' => bp_displayed_user_id(), 'follower_id' => bp_loggedin_user_id() ) ) )
    			bp_core_add_message( sprintf( __( 'There was a problem when trying to follow %s, please try again.', 'bp-follow' ), bp_get_displayed_user_fullname() ), 'error' );
    		else
    			bp_core_add_message( sprintf( __( 'You are now following %s.', 'bp-follow' ), bp_get_displayed_user_fullname() ) );
    	}
    
    	// it's possible that wp_get_referer() returns false, so let's fallback to the displayed user's page
    	$redirect = wp_get_referer() ? wp_get_referer() : bp_displayed_user_domain();
    	bp_core_redirect( $redirect );
    
    	return false;
    }
    add_action( 'bp_actions', 'bp_follow_action_start' );

    And the problem coult come from this line :

    if ( bp_displayed_user_id() == bp_loggedin_user_id() )
    		return false;

    BUt what i could do fot fix it ?

Viewing 16 replies (of 16 total)