Wordpress. Get the data from admin-post.php after unsuccessful form validation Wordpress. Get the data from admin-post.php after unsuccessful form validation wordpress wordpress

Wordpress. Get the data from admin-post.php after unsuccessful form validation


Use transients if the user is logged in and set them to expire about 60 seconds, setting the data in your admin_post action then retrieving them in your form page. I'm still looking for a nice solution that doesn't involve posting the form back to itself by setting action="" in the form and not using the admin_post action.


Whether 'simple' or 'hard' programming, instructions need to be given to the machine. Think about how would you accomplish it with just plain PHP. You are basically being redirected to another page after unsuccessful login. Since HTTP is stateless, you can store the data either on the server side (in database, session, files..) or you pass the information in the URL. WordPress wouldn't just automatically start a session for you to store last form submission.