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 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
- Which hook should be used to add an action containing a redirect?
- ‘Password field is empty’ error when using autofill in Chrome
- Is there a WordPress core & plugins update action hook?
- trigger save_post event programmatically
- is it possible to get the hook name in add_action?
- What hook is executed just after wp_query has been executed?
- Error 310 too many redirects after switching domains
- Redirect after login based on user role (custom login page)
- How To Only Allow Users To View Their Own Buddypress Profiles? [closed]
- WooCommerce – Overwrite action hook [closed]
- is_user_logged_in not working to redirect only logged out users
- How to modify the Register link in the login page?
- Proper way to pass credentials in a custom login form to avoid “headers already sent”
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- Hook when new CPT published AND postmeta inserted
- When WP_CLI runs WordPress from the command line, are hooks called?
- How to redirect on login to a specific page if a specific meta user is empty
- Query categories that have a description
- How To Redirect /url.html to /url?
- Remove #wpcf7-f2450-o1 with Contact form 7 redirect [closed]
- Action hook for custom tax edit
- I don’t understand how add_action and do_action work in tandem. The former executes the code already…what is do_action for?
- Insert HTML in post, below nav bar but above content?
- Convert Gravity Form Entry Date on Export
- Hook Adding content after title
- Fatal error: Call to a member function get_queried_object_id()
- “admin_enqueue_scripts” hook or $_GET[‘page’]?
- How to add content to suscriptor dashboard frontend?
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Add PHP code to header section from plugin
- Action hook save_post for newly created posts – $post object data is all empty
- add_filter to the_content from plugin function
- What hook should I use that will fire whenever I open a post for editing in the WP back-end?
- Send admin to a different login than users?
- Is there a author_update action?
- How to set Media Box form elements default value?
- Date based redirects of posts that no longer exist
- Re-Direct ALL Users to the Home Page IF not logged in
- Redirect to dashboard user once you click on Publish page
- Problem in auto login after registration
- remove_action not working for a function
- Debug a WP install: how to find which functions write post updates during a process (a woocommerce checkout in my case)
- What hook should I use to add post meta data with on update?
- Why https://www. SUBdomain is redirected by WP to https://MAINdomain
- Redirect /member/ to /member/user
- How to override get_avatar() function?
- How to modify the WordPress comes with redirect
- Conditional redirect on login using referring URL
- Redirect user to login and then to page where they came from
- Hook into create_category
- $GLOBALS & global doesn’t work [closed]
- Hooks not working on live server
- WordPress MU: Cookie error when trying to login on network WP instance
- Custom Post Type slug has the same Redirection entry