1

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

4

1 回答 1

2

如果表单发布带有参数的字段,name则会导致 404。

于 2013-09-24T17:19:01.520 回答