Hi All,
I am using the social login plugin with my classipress theme. I am trying to redirect all users logging in to their edit profile page.
I had successfully managed to redirect users logging with the normal login form using this code in functions.php
function redirect_to_dashboard( $redirect_to, $request, $user ) {
return home_url('/edit-profile');
}
add_filter( 'login_redirect', 'redirect_to_dashboard', 10, 3 );
For social login, I had updated the functions.php in my child them with this code. Users still are redirected to the home page.
function fix_redirect($redirect_to, $user_data)
{
return home_url('/edit-profile');
}
add_filter('oa_social_login_filter_registration_redirect_url', 'fix_redirect', 10, 2);
add_filter('oa_social_login_filter_login_redirect_url', 'fix_redirect', 10, 2);
Your help is really appreciated on how to fix / debug this.
Answers
Maybe something like this:
function redirect_to_dashboard_2( $redirect_to ) { return home_url('/edit-profile'); } add_filter( 'registration_redirect', 'redirect_to_dashboard_2', 10, 1);
And without the oa_social_login_filter filters.Let us know!
Thanks for your timely reply here. I had tried the code above, but it did not fix my problem. I believe oneall social login does not use loginredirect , registerredirect hooks?!
PS. I have tried from both the registration form and login form with no luck.
Are you trying to redirect newly registered users, or users logging in?
What redirection setting do you have in the Social Login plugin settings?
I am trying to redirect in both scenarios.
In the settings, I have redirection setting as: Redirect users to their account dashboard