Kind of – I would suggest using init
. This would probably be the best way of doing it since you can process the form as described below. wp_head
would work though. Also, you should make sure you are making necessary checks with ‘nonces’.
I suggest the init
hook as you can employ something similar to ‘post-redirect-get’ (see here). This can help against resubmission of data when users click refresh. The usual way of doing this is to submit the url of the page along with the form, submit to a processing page, which when it’s finished then redirects the user back to the original page (or a confirmation page).
Of course you don’t need a separate ‘processing page’. An action hooked onto init
can check a form is submitted, check the nonces, process the form and then redirect back to the page.
Related Posts:
- How to define form action in JSF?
- 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?
- Best way to create multi-step form with data saved to user account for later updating?
- 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
- recommended practice for form submission
- Built-in data validation function for URLs
- Checkbox won’t check when label is clicked
- Trying to save and display a wp_editor()
- Contact forms going into spam folder
- Performing a POST action on homepage goes to posts page
- Add contact form
- creating form for wp_remote_post
- How to know what submit button the user clicked?
- CRUD front end for mySQL in WordPress
- How to edit custom user meta information front end
- 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”
- 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
- Use $_POST data in functions.php
- Where to add css file that I want my forms to use?
- Downloadable content only for subscribers?
- How to Collect Keyword and Search Engine Data on Webforms?
- free form wordpress
- Form submission in WordPress front end
- How to code auto-retry for API call
- How to check form input against PHP variable?
- form action wordpress and php
- Show button once Contact form 7 is submitted
- WordPress Emails & Contact Forms [closed]
- How to move HTML form to WP Theme
- Is there a reset_button()?
- How can I modify labels in default wordpress registration form? [duplicate]
- Display number of sign-ups [closed]
- Contact form submit, having to click twice
- Is it possible to pass variables to WordPress externally?
- Form within thickbox
- Restore Cforms II Form Presets
- Making an input field required from WP’s perspective
- Front end post form validation
- How to take large file uploads from users the right way
- 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
- gravityform – retrieve multiple check answers “keys” instead of “values”
- Code for front end validation for forms not working
- WordPress – Users with contact form on profile
- How to stop iFrame form from reloading on mobile?
- using esc_html_e string in custom form using code snippets
- How do I implement form handling when form is custom HTML?
- I’m needing to figure out how to create a page that user could create a “task” and it be selectable on a form
- 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
- Sending Form data as Attachment
- Trigger action when submitting form with WPForms [closed]
- Form submissions that require users ID# [closed]
- Unable to submit form using admin post wordpress
- import excel form into wordpress
- Form data from wordpress theme to be submitted in other site url
- Send contact form to a specific referrer-email adres
- wp_nonce for Front-End submission form not working
- Displaying errors on the front end from my plugin
- Pay before posting (frontend insert post)
- admin_post in object oriented plugin
- Contact form spam, without form?
- Custom Contact Form Not Sending (but not giving error)
- 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?
- How do I capture the selected option and pass in sending the registration form?
- Custom form on front page redirects on error page
- Issue with contact form 7
- Advanced searching form
- Cannot access a file in the theme (twentynineteen-child) folder
- Dropdown List Won’t Display Selected Option After Submit / Refresh
- Dynamic price for payment button
- Forms lead to “Page not found” in Ultimate Member plugin
- How to use tag in wordpress?
- How can I get lost form data back? [closed]
- How can I add email code authentication on form submission without any wp plugin?
- Implementing Autosave Functionality for Long, Multi-page Forms in WordPress