Wordpress Plugin - Conditional Redirect after Login based on WP role

Hi,

Could you suggest a way to redirect to different URLs after logging in based on WP role?

Thanks,

Richard

Best Answer

  • Richard_KwanRichard_KwanMember
    Answer ✓
    Never mind, I found the answer:

    //Redirection for existing users
    function oa_social_login_set_redirect_url_existing_users ($url, $user_data)
    {
    //Force the url to something else
    $url = 'http://my-website.com/welcome-back/';

    //Returning users will be redirected here
    return $url;
    }
    add_filter('oa_social_login_filter_login_redirect_url', 'oa_social_login_set_redirect_url_existing_users', 10, 2);

    Welcome!

    Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

    Please click on the link below to connect to the forum with your OneAll account.