Re-showing a custom form after validation fails

[ad_1]

Hi, I’m a long time PHP dev but first time WordPress custom theme and plugin dev and I’m struggling to work out something that’s probably simple:

I’m posting a custom form and using a function to process the contents of the form, it’s posting using admin-post.php and an admin\_post\_nopriv\_{action}, it’s running the function OK but how do I get WordPress to re-show the same form if my validation fails?

So I want to post the form, check the fields, if there’s a problem, re-show the form where I can then show a list of the problem(s) and put the variables into the form so the user can edit their input.

Thank you.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer