
I’ve been banging my head against the wall with this, and I just can’t seem to figure out what i need to do to get it to work
I have a form with 3 visible fields and one hidden field.
When the user submits their choices for the 3 visible fields, I want to update the value of the 4th field based on a query.
Essentially, the query is:
Step 1: find all ‘custom posts’ with {FIELD 1-3} terms
Step 2: get {FIELD 4} terms from all the custom posts from step 1
Step 3: shove all the terms from step 2 into an array
Step 4: update the value of FIELD 4 on the form according to the array from step 3.
Now, the form fields aren’t being saved anywhere permanently. They’re basically just being used to get some data from the user, then redirect to the most appropriate place based on that data.
What would be the best hook/action/whatever to use to update the 4th field? Is there an easier way to do this? I’d assumed acf/save_post or possibly that it could be done during validation, but neither seem to be cooperating.
I’m currently using ACF Pro with advanced forms and… lots of ibuprofen.
Kudos, thanks for your help