BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 3
    Vincenzo De Martino on #5296

    Hi Brajesh,

    function bbit_auto_follow_users( $user_id ){
    if ( function_exists(‘bp_follow_get_following’) ) :

    // Add your user ids here
    $users_to_follow = array( ‘2’ ); // user id 2 is BossBet

    foreach ( $users_to_follow as $follow_user ) {
    bp_follow_start_following( array( ‘leader_id’ => $follow_user, ‘follower_id’ => $user_id ) );

    // If you don’t want them to follow back remove the line below
    // bp_follow_start_following( array( ‘leader_id’ => $user_id, ‘follower_id’ => $follow_user ) );
    }

    endif;

    }
    add_action(‘bp_core_activated_user’, ‘bbit_auto_follow_users’, 10, 1);

    I have this code to auto – follow after registration .
    Vincenzo

  • Participant
    Level: Initiated
    Posts: 3
    Vincenzo De Martino on #5294

    Hi Brajesh,

    This code “bp_core_activated_user”, is present in the function- bp.php file

    What can I do to make it work ?

    I hope you can help me because it’s important for my job

  • Participant
    Level: Initiated
    Posts: 3
    Vincenzo De Martino on #5287

    Forgot to add: although the icon keeps “loading” and nothing happens, the registration completes with no confirmation email and when I refresh the page I’m logged in