Adding my validation and non-acf fields update code into the ‘acf/save_post’ (pre) has resolved my issue. Thank you gentlemen for your help!
Haha … yes definitely have a custom <form>
with a method="post"
!
It was working fine before I added the acf_form()
and the acf_form_head()
!
I was expecting to have to save the ‘acf’ data as you described above.
I’ll cobble together a concise full example and post here if I’m still running into issues.
Thanks again
Thanks again for your help.
I placed the code above into my functions.php file, but the event doesn’t seem to be firing. Neither am I getting anything coming through in the $_POST(‘acf’)
Turns out it is only saving my acf fields data, and is no longer saving my other meta data now. When I click the ‘Submit’ button, it now seems to coming back as a GET request method????? Maybe the acf_form_head() is redirecting again once it has save the ACF fields it knows about, so it’s never getting to my POST processing code?
I need to do some more testing I think… will post an update once I have figured out whats going on.
Thanks for your reply – that’s been really helpful and I’ve pretty much got it working as I need to now. It was a nice surprise to find that the acf field data seems to be saved automatically without having to program manually. However, I don’t seem to be getting anything POSTed in the $_POST(‘acf’) array. I wondered if it was because I was running the free version (v4)? I have now upgraded to Pro (v5) and it still doesn’t seem to bring anything through. Is there an additional setting in acf_form() options that I have to set?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.