Home › Forums › General Issues › Issue with update_field › Reply To: Issue with update_field
Looking at your original code, see my comments in the code
$field_key = "average_review_score";
$value = "8";
$post_id = "3";
$get_av = get_field( "average_review_score", $post_id );
echo $get_av;
// this is updating the post with an ID of 3
// it is not updating a term in a taxonomy
update_field( $field_key, $value, $post_id );
If your intent is to update a field that is attached to a term in a taxonomy then you need to use a $post_id that represents that term. See “Getting values from other places” on this page https://www.advancedcustomfields.com/resources/get_field/
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.