BuddyDev

Search

[Resolved] Redirect users only for first login to a specific page

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #31465

    Hello,

    I use this plugin to https://wbcomdesigns.com/downloads/buddypress-redirect/ to redirect all user login to the site wide activity page but I was wondering if its possible to redirect all users only on their first login to a different page (welcome page) while subsequent logins will redirect back to the site wide activity page. Only the first login should overwrite the redirect to the site wide activity page.

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #31474

    Hi Tosin,
    you are using the plugin for a 3rd party vendor. I will suggest asking them.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #31475

    OK thanks

    But can this be achieved using a simple code like this for login redirect

    
    function custom_login_redirect_to($user_login, $user) {
    	bp_core_redirect( get_option('siteurl') . "/profile/" );
    }
    add_action('wp_login', 'custom_login_redirect_to', 10, 2);
    

    I found this link https://buddydev.com/buddypress-tutorial-redirect-user-first-login/

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #31521

    Hi Tosin,
    Thank you for the reply. I am glad the above code is working. Since you were using a 3rd party plugin(and we have a similar plugin), I had suggested for their support.

    Thank you
    Brajesh

  • Participant
    Level: Guru
    Posts: 900
    Tosin on #31522

    Sorry for the confusion, I could not get the code to work and I actually would prefer using your plugin but I want all normal redirects to go to the sitewide activity page instead of the redirecting to profile so that’s the main reason I could not use your plugin https://buddydev.com/plugins/bp-redirect-to-profile/

    Is there a way to make your plugin redirect elsewhere instead of profile so maybe then you could help with applying your suggestion here https://buddydev.com/buddypress-tutorial-redirect-user-first-login/

    SO by using your plugin
    1. All FIRST LOGINS REDIRECT TO A WELCOME PAGE
    2. ALL SUBSEQUENT LOGINS REDIRECT TO SITE WIDE ACTIVITY PAGE

    In fact, this might be a better opportunity for you to create a more comprehensive and dynamic login redirect plugin which can also work in harmony with this plugin below without any login or redirect conflict.
    1. Buddypress member types pro
    2. BP Auto Login on Activation
    3. BuddyPress Auto Activate Autologin Redirect To Profile On Signup

    Thanks for your help

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #31530

    Hi Tosin,

    If you are using BuddyPress Member Types pro, the functionality is already there.

    You can setup the first redirect and custom redirect for each member type. I do believe, setting a global option for the same will be easy.

    I do plan to update the profile redirect plugin with this feature in the very near future.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: resolved