I’m working on a plugin that will integrate with ACF to do the following.
– Display a form on the front end.
– Get the responses and save them as a new CPT.
– Redirect the user to a ‘Thank you’ page when submitted.
The context is that this plugin uses a custom template that’s inside the plugin directory. I’m doing this because when the project is finished, I won’t necessarily have access to the file structure of my sites, but I will be able to load plugins and all the sites use ACF.
The only thing the template really does is
This should ensure that I have access to everything ACF needs before the head is called. So, using ACF v4.4.1 I’ve got it where I can use a shortcode e.g. [generate_form submit="foo" redirect="bar"].
The catch is that the only thing that seems to not work is my redirect. When I submit the form, the same page reloads, but without the form. Why would this not work correctly? Everything else about the plugin and template seem to be working.
The attached file is most of the code (without the CPT code).