Social Login Redirect

This topic contains 10 replies, has 4 voices, and was last updated by  Jeff Adams 5 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #2497

    Jeff Adams
    Buyer
    Post count: 1780

    When a new users selects facebook using the social login is there a way to make it redirect to a certain page like I can do with other ways of registering. I need them to go to an https://veganlinked.com/add/ like i have it doing after someone registers.

    #2499

    Alex Rollin
    Moderator
    Post count: 27815

    Patrik has done some work on that recently. Let me flag this topic for him for an update.

    #2500

    Jeff Adams
    Buyer
    Post count: 1780

    Awesome, thanks!

    #2501

    Patrik
    Moderator
    Post count: 1971

    Hi Jeff,

    We have provided a filter to set redirect after login which is available for login form and social login both. Please put the following code in active theme’s functions.php and let me know if it helps:

    
    
    add_filter('uwp_login_redirect', 'uwp_login_redirect_cb');
    function uwp_login_redirect_cb($redirect_to){
        if( ! isset( $_POST['uwp_login_nonce'] )){
            $redirect_to = site_url('add');
        }
        return $redirect_to;
    }

    Regards,
    Patrik

    #2502

    Jeff Adams
    Buyer
    Post count: 1780

    Before I do, couple quick questions:

    Does it matter where I put this code in the functions.php? Like, should I put it at the top, bottom, in the middle somewhere?

    Will this change be overwritten? Or will this be included in the next update?

    #2503

    Patrik
    Moderator
    Post count: 1971

    You can put anywhere in functions.php but I recommend put at the bottom last. This is the filter which can be used for the website who has requirements to redirect to the custom page. This will overwrite the setting. This will not be added in the plugin core in next release.

    Regards,
    Patrik

    #2504

    Jeff Adams
    Buyer
    Post count: 1780

    Thanks, when the next release comes out though I’ll have to reinsert this then?

    #2505

    Jeff Adams
    Buyer
    Post count: 1780

    And, which functions.php, the theme’s? or the directory starter? I’m assuming the theme…

    #2506

    Patrik
    Moderator
    Post count: 1971

    Yes, functions.php of the currently active theme. This will not overwrite by the updates of the UsersWP plugin as the code is in the theme’s file.

    Regards,
    Patrik

    #2512

    Paolo
    Site Admin
    Post count: 31206

    or you can use the code snippets plugin. That is even safer, because it could happen that you need to update the supreme child theme…

    Thanks

    #2516

    Jeff Adams
    Buyer
    Post count: 1780

    Thanks Paolo, I’ve notice you guys reference code snippets before. I’m excited to use it. I just did for this code and it worked like a charm! I tested everything and it redirected great, thanks guys!

Viewing 11 posts - 1 through 11 (of 11 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket