Home › Forums › General Issues › Updating fields in Groups in acf/save_post › Reply To: Updating fields in Groups in acf/save_post
The true way for update / create a sub field of a group is with this :
update_field('the_group', array('the_element_to_update'=>$value), $post_id)
With this way :update_field('the_group_the_element_to_update', $value, $post_id)
If the field has’nt been created before, it don’t work, because in the database the meta_data _the_group_the_element_to_update is empty and then, you can’t get the value of the field.
`get_field(‘the_group’, $post_id)[‘the_element_to_update’] is empty.
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.