Home › Forums › General Issues › acf/save_post not working with calculated update_field › Reply To: acf/save_post not working with calculated update_field
Since it’s the second function that you’re having a problem with…
Without seeing it all, and I’m not sure I want to if you’re dealing with 100+ fields, here are some suggestions about things that might be wrong, and some of this might be obvious.
Make sure that you’re getting the values you need to manipulate from the DB. So if
$proposal_input is dependent on a value in another field then you need to do
$proposal_input = get_field('proposal_input', $post_id);. Values retrieved in the first function will not be available in the second function, you need to get them again.
Are these fields that have already been created and that already exist. If you are attempting to update a field that does not already have a value in the database then using update_field() with the field name will fail, you must use the field_key.
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!