Redirect to author page on login?
-
Hi.
I notice there’s a filter that redirects both login and register to a certain url.
function oa_social_login_filter_redirect_for_new_users ($url, $user_data) { //Force the url to something else $url = 'https://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 = 'https://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);
I have individual member pages set up for each user when they register.
eg https://www.site.com/member/usernameI would like to know how to forward it to these pages. I have a filter that does so on normal login/register which may be helpful but I can’t seem to transfer the code over.
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;}
- The topic ‘Redirect to author page on login?’ is closed to new replies.