Home › Forums › ACF PRO › update field is updating value in database but on the frontend › Reply To: update field is updating value in database but on the frontend
When using update_field() you must supply the actual value that ACF stores. For example the documentation shows how to update a checkbox field with an array. In the case of fields types like a post object field, ACF stores the ID of that post object and not the actual post object. So if you are supplying the entire post object in the updated then ACF does not know what to do with it, or it is attempting to update the value and failing.
I’m asking you what the value of $team_code is because I can’t tell this by looking at your code. I haven’t got a clue what
$team_code = rgar( $entry, '10' ); does.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.