I have a form in a Wordpress blog that uses a PHP file as the action for a POST when the form is submitted. The PHP file is outside the normal WP context, but I want to be able to read some custom fields from my WP database, so I have included wp-blog-header.php in this file as explained here. However, as soon as I include the file, the POST fails with a 404. If I remove the include it works fine. Does WP have some sort of security mechanism that prevents wp-blog-header.php from being loaded on a POST? Is there some way to get around this?
The main goal is to pull the value from an Advanced Custom Fields field on a particular page in my WP site. If there is a good way to do this without including wp-blog-header.php I'm open to suggestions.
Thanks