Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirecting to different page if sign up / log in? #156

Open
charlieelcarlino opened this issue May 1, 2023 · 1 comment
Open

Redirecting to different page if sign up / log in? #156

charlieelcarlino opened this issue May 1, 2023 · 1 comment

Comments

@charlieelcarlino
Copy link

Hi, thanks for the plugin! Is it possible to redirect the user to a different page the first time he signs in (aka, when he registers)?

Thanks again

@mymariusz
Copy link

It will redirect to the page from where you entered the login form or where you are currently on.

function redirect_after_login($redirect_to, $request, $user) {
if (isset($user->ID)) {
return $request ? $request : home_url();
}
return $redirect_to;
}
add_filter('login_redirect', 'redirect_after_login', 10, 3);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants