There’s a registration_redirect
filter you can use:
add_filter( 'registration_redirect', 'wpse_129618_registration_redirect' );
function wpse_129618_registration_redirect( $redirect ) {
if( isset( $_SERVER['HTTP_REFERER'] ) && 0 != strlen( $_SERVER['HTTP_REFERER'] ) ) {
$redirect = esc_url( $_SERVER['HTTP_REFERER'] );
}
return $redirect;
}
Alternately, you can edit the PHP that is generating your <form>
and add a hidden field named redirect_to
, using the current page’s address (ie, $_SERVER['PHP_SELF']
).
References
Related Posts:
- How to display user registration form on front-end of the website?
- What is an easy way to display a front-end user registration form?
- User registration problem in WordPress
- Custom Registration Template/Page
- Registration form labels – add asterisk
- How to create and retrieve data from a special registration form?
- How can I create registration form for users which I can assign role and profile picture?
- Adding a new user from the front end
- Downloadable content only for subscribers?
- Create a registration form with a PayPal checkout fee? [closed]
- How can I modify labels in default wordpress registration form? [duplicate]
- Display number of sign-ups [closed]
- WordPress – Users with contact form on profile
- How to call or add password input / generate password / password strenght meter in custom registration form?
- Username from e-mail
- Create register form plus send post
- WordPress – custom user flow registration approval
- How do I register user without being authenticated
- Creating a contact form without a plugin [closed]
- How to submit data from HTML form?
- Can I verify nonce which was generated on a different WP site?
- Sending form data via PHPMailer – How to action PHP script from a form
- how to handle forms in multiple pages?
- recommended practice for form submission
- Built-in data validation function for URLs
- Gravity Forms skip form if already filled out using cookie?
- One comment per user per post
- Registration e-mail check with AJAX
- WordPress registration and contact form 7 [closed]
- Contact forms going into spam folder
- Using the WordPress selected() function
- Return to option page after running PHP script
- Form doesn’t submit on second submit call
- Stripe Error: must provide source or customer [closed]
- How to submit form in a PHP file in WordPress?
- How to prevent page from resubmit on refresh when “Cannot modify header information – headers” warning shows
- How to edit custom user meta information front end
- Create register form without a plugin
- Google Map Latitude and Longitude values in form
- How to properly add a custom submenu to the user’s admin menu
- How can I find actual logic php file in form’s action path?
- How do I use the info submitted in a form to create a form reception page? (like “thank you {firstName}”) [closed]
- WordPress form to shortcode
- Create Contact7 Form programmatically [closed]
- recaptcha working on local but not on live wordpress sites [closed]
- User input form field value validation ninja forms 3
- Can you disable the mail function in contact form 7 [closed]
- Using form parameters within a WordPress “Page”
- How to bring registration field to index page? [closed]
- Can I make Contact Form 7 change over to a new page? [closed]
- A mandatory agreement form to access another page?
- placeholder text in category form label
- Creating short code for search form
- nonce in custom form is not verifying
- textarea field is getting escaped for some unknown reason
- Where to add css file that I want my forms to use?
- How to Collect Keyword and Search Engine Data on Webforms?
- free form wordpress
- How to add fields in custom registration form, validate it and aave to db? [closed]
- Form submission in WordPress front end
- form action wordpress and php
- WordPress Emails & Contact Forms [closed]
- How to move HTML form to WP Theme
- Custom login and registration forms
- Form within thickbox
- Restore Cforms II Form Presets
- Making an input field required from WP’s perspective
- Cannot modify header form resubmits data on refresh
- wordpress forms submit
- wordpress blog, is there a way to make anyone post in a blog without having login info
- Linking form to user meta fields
- Code for front end validation for forms not working
- Perform multiple actions after wp_insert_user()
- using esc_html_e string in custom form using code snippets
- How do I implement form handling when form is custom HTML?
- Forms cut off when on mobile
- How to create a custom range slider in wordpress form?
- Sorting wordpress data in excel
- Quickly Maintain/edit 100+ WordPress Forms on multiple websites
- Pricing depending on selected items in a multi step form
- Prevent malicious scripts to be submitted in post
- Registration form AJAX check for existing username (simple version)
- Sending Form data as Attachment
- Trigger action when submitting form with WPForms [closed]
- Form submissions that require users ID# [closed]
- Form data from wordpress theme to be submitted in other site url
- wp_nonce for Front-End submission form not working
- Pay before posting (frontend insert post)
- How to use the in WP
- How to send form values from the script in functions.php and not from the form on my website?
- view and update form only for registered users
- How do I capture the selected option and pass in sending the registration form?
- Insert Extra fields added in the front end registration form to DB
- Issue with contact form 7
- Advanced searching form
- Cannot access a file in the theme (twentynineteen-child) folder
- Help finishing script to export WP user data when form submitted
- Dropdown List Won’t Display Selected Option After Submit / Refresh
- wp_usermeta key problem
- Is it possible to change the error message “This is a required field” for all checkout fields? [closed]