Specify redirect on magic login #6
alpha-pix
started this conversation in
Feature Requests
Replies: 2 comments
-
|
This is already possible with a native WP Core filter. add_filter('user_dashboard_url',function (string $url, int $user_id, string $schema) {
// Return the default if the user is an admin,
// You can customize this condition based on your needs.
if (user_can($user_id, 'manage_options')){
return $url;
}
return site_url('/my-account', $schema);
}, 10, 3); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Agree, that's a good idea. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be helpful to specify a default magic login redirect in the config, for sending with the link. For BuddyBoss, that might be https://site.com/members/me/. For a Woocommerce site it might be https://site.com/my-account/
Ideally this could be overidden by a shortcode modifer, so that for example a invitation to magic link in WC checkout would return the user, once logged in, to the checkout page.
Beta Was this translation helpful? Give feedback.
All reactions