Support

Account

Home Forums Front-end Issues _acf_nonce always "false" in $_POST

Solving

_acf_nonce always "false" in $_POST

  • Hi, this is possibly merely a question and not an issue –

    I have an acf_form(), and it creates all the hidden fields it’s supposed to create, including “_acf_nonce” with a numeric value. On submit, the form “is validating”, and eventually, is “validated”, then moves on to “/?updated”.

    However, when I look at the $_POST I always get “acf_nonce => bool(false)”, which makes me think something is not safe and ok after all.

    Thanks for a brief reply.

  • Just did a quick look at a site that is using acf_form and I find this in the generated form

    
    <input type="hidden" id="_acf_nonce" name="_acf_nonce" value="17630f97db">
    

    I do not know what is causing this on your site. I would start by seeing if there is some type of plugin conflict by deactivating other plugins. Also not the difference in the field name, on my site it starts with an underscore (_)

  • Oh, I didn’t realize this thread was accidentally submitted twice, sorry for that.

    In the other one with the same title I think I already answered my own question, which wasn’t about the nonce value generated in the form field, but the value returned in the $_POST.

    I found this with respect to the latter:

    According to this document listing acf code –

    https://docs.wpdebuglog.com/plugin/advanced-custom-fields/5.8.8/function/acf_verify_nonce/

    acf resets the nonce to “false” upon verification so the form can only be submitted once with this nonce. So “false” as value for ‘acf_nonce’ in the $_POST actually means ‘verified’, if I’m not mistaken.

    Although I wonder if changing “false” to “verified” for “acf_nonce” in the $_POST may make it easier to understand what is going on?

    Thanks for your reply!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.