Add a nonce to your redirect url.
See the examples in the codex for wp_nonce_url()
. Use wp_verify_nonce()
to check for the nonce and run your function to load the modal.
You might also want to check if is_user_logged_in()
in this case.
Related Posts:
- after login that will redirect user role into a page
- Redirect users on specific post category or category page
- A good hook to check authorization and redirect?
- is_user_logged_in() doesn’t work after custom login and redirect
- Is there a hook that runs after a user logs in?
- Is there a hook before the user is authenticated?
- Password change when the user login first time
- Run javascript code after wp_login hook?
- Detecting post type within init action
- Wp_update_post: Infinite loop even with remove_action solution, OOP
- Redirect logged in users if they are on a specific page
- How can I do customizations on login, registration and password recovery forms?
- wp-login.php — redirect logged in users to custom URL
- Redirect user after login/registration globally
- Redirect to login page
- wp_redirect() not working on form submission with init hook
- Stuck in redirect loop after using wp_login action
- How to get session token of current user in wp_login hook?
- Changing “Lost Password Email Link” to custom password reset page
- Custom action on login and “remember me”
- Redirect Logged In User if page is wp-login.php and $_Get[‘level’] = X
- How to include error message on login
- Redirect user to previous page after signup from custom form
- Redirect customer to login if not logged in when proceeding to checkout
- When are wp redirect methods safe to hook?
- Send along login credentials with comment content
- Is it possible to add the_content filter upon login?
- Redirect no product url’s to static url
- Block Update Profile Errors
- Redirect User to login page
- What hook to use to redirect based on $post
- Trying to re-direct users to specific page based on an ACF variable
- How to read and write session data?
- Template_redirect works, but headers aren’t sent when checking via cURL
- template_redirect hooks redirect wrong URL
- Keep the old referrer after failed login
- Output Redirect Headers on Admin Dashboard Page
- Updating user meta data from external link, user not logged in
- Problem with call_user_func_array front end
- redirect_to how to make it simply work with get parameter or similar?
- Which method to use when deleting posts from the front-end
- Which hook should I use for this scenario regarding the registration process and account/profile update?
- How to add a new link to the default register form’s footer links?
- How to use the password_reset hook to validate new password and display error
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error
- Does wp_login hook fire on user registration?
- Changing login url
- Show admin notice if metabox field is empty during save post
- Redirecting after login except for a specific page
- Why is pre_get_posts hook invoked multiple times?
- Internal redirect from page to category
- WordPress Redirect After logging
- Redirect /member/ to /member/user
- Login redirects to home page and doesn’t log in
- is_page not triggering
- wp-login.php?redirect_to=https problem
- WordPress not loggin user and redirecting after custom registration
- wp_redirect leading to an infinite loop
- admin_post_(action) hook create console log error
- Undefined fieldId in gform.addFilter for limiting dates in datepicker – Gravity Forms
- How to I prevent WordPress from switching external HTTP links to HTTPS?
- How to redirect new registrars to a custom registration page instead of WP default registration page?
- Stylesheet is getting removed/deregistered automatically
- custom error message or redirect to custom page if any error occurs
- redirect to a custom page
- Trying to login to my site redirects me to the first page
- How to override get_avatar() function?
- redirect after account activation for forum using bbpress and buddypress
- Check if front page within function passed to action
- How can I insert custom html code inside a div dynamically?
- Get First Post content and edit it using pre_get_posts (or similar?!)
- How to trigger click events using hooks
- using wp_rewrite but keep the original url in the address bar
- stop customize.php redirect to login page if admin is not logged in
- WP_mail() Issue. Duplicate emails if $_GET[‘A’] == email
- Are there Hooks for featured image popup?
- ERROR: Cookies are blocked due to unexpected output – ultimate solution
- how to do display: block after user login
- Hook after creating a post and retrieve infos from this post immediatly
- Check get_post value after wp-admin login
- redirect_to ignoring the SSL
- Identify if the_post hook is being called from the admin post list
- Redirect user on login using extra field value on login form
- Hooks with same priority number. Can one stack items returned in divs, position: absolute each with their own z-index?
- redirect_to not Including Hashtag from URL
- trying to locate the correct file to edit my internal linking anchor tags
- add extra parameter in default hook in wordpress
- Redirect users in first login to a dynamic link
- remove_action() hook not working
- Woocommerce login to specific page or referrer
- Display custom debug info inside page and not before head
- wp-login.php redirect problem
- login redirect problem – db charset issue?
- Can add_image_size be added earlier
- WordPress sending data with add_action
- Change user role if it’s orders count more than
- How to hide / remove attachment “alt” or “caption” field in Admin?
- How to redirect 404s that generated for css&JS files?
- WordPress logged in but no access to wp-admin
- calculate values from a field and insert them into custom fields when publishing or updating post