BuddyDev

Search

[Resolved] Redirect on first login – xprofile


  • Participant
    Level: Enlightened
    Posts: 39
    Vivek Mathur on #21670

    Hi, i saw your tutorial https://buddydev.com/buddypress-tutorial-redirect-user-first-login/

    this would redirect to the profile.

    what change would need to be made in this snippet if i want to redirect to prompt the user to fill the xprofile fields in “/profile/edit/group/2/”

    thanks!


  • Keymaster
    (BuddyDev Team)
    Posts: 11216
    Brajesh Singh on #21675

    Hi Vivek,
    You can change this

    
    $redirect_to = bp_core_get_user_domain($user->ID );
    

    To

    
    $redirect_to = bp_core_get_user_domain($user->ID ) .'profile/edit/group/2/;
    

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 39
    Vivek Mathur on #21723

    Thanks Brajesh,

    However, getting a fatal error on the snippet given in the tutorial.

    The code snippet you are trying to save produced a fatal error on line 22:

    syntax error, unexpected ‘login_redirect’ (T_STRING)

    Could you please advise if im doing something wrong?

    thanks,
    Vivek


  • Keymaster
    (BuddyDev Team)
    Posts: 11216
    Brajesh Singh on #21835

    Hi Vivek,
    I am sorry, There was an issue with the previous code. It should be

    
    $redirect_to = bp_core_get_user_domain($user->ID ) .'profile/edit/group/2/';
    

    I had missed the last single quote.

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 39
    Vivek Mathur on #23005
    This reply has been marked as private.

  • Keymaster
    (BuddyDev Team)
    Posts: 11216
    Brajesh Singh on #23006

    Hi Vivek,
    Are you using any other plugin that provides activation redirect or login redirect(like our auto activate auto login plugin?)

    Regards
    Brajesh


  • Participant
    Level: Enlightened
    Posts: 39
    Vivek Mathur on #23027

    It works. My mistake- there was a conflicting setting in theme for redirect after login.

    thanks!


  • Keymaster
    (BuddyDev Team)
    Posts: 11216
    Brajesh Singh on #23036

    No issues.

    Regards
    Brajesh

The topic ‘ [Resolved] Redirect on first login – xprofile’ is closed to new replies.

This topic is: resolved
Subscribe