function oa_social_login_filter_redirect_for_new_users ($url, $user_data)
{
//Force the url to something else
$url = 'http://www.google.com';
//New users will be redirected here
return $url;
}
add_filter('oa_social_login_filter_registration_redirect_url', 'oa_social_login_filter_redirect_for_new_users', 10, 2);
//Redirection for existing users
function oa_social_login_filter_redirect_for_existing_users ($url, $user_data)
{
//Force the url to something else
$url = 'http://www.google.com';
//Returning users will be redirected here
return $url;
}
add_filter('oa_social_login_filter_login_redirect_url', 'oa_social_login_filter_redirect_for_existing_users', 10, 2);
add_filter("login_redirect","redirect_to_profile",100,3);
function redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user)
{
if(empty($redirect_to_calculated))
$redirect_to_calculated=admin_url();
if(!is_admin($user->user_login))
return get_author_posts_url($user->ID,$curauth->user_login);
else
return $redirect_to_calculated;
}
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.
Answers
function oa_social_login_set_registration_redirect_url ($redirect_to, $user_data) { return 'http://www.site.com/member/'.$user_data->user_login.'/'; } add_filter('oa_social_login_filter_registration_redirect_url', 'oa_social_login_set_registration_redirect_url');
i have the problem that redirections doesnt work. i put all to redirect to my homepage, but when doing the login with the plugin always get redirected to "my-profile" page...why? does this code can help me? in what file i can put it? thanks
This code should be placed in the functions.php or your Wordpress theme.
You can edit this function via the administrator dashboard: Appearance \ Editor \ Theme Functions (functions.php).
Hope this helps.