Home › Forums › Front-end Issues › update_field() for comment fields › Reply To: update_field() for comment fields
Hi @zanetaylor
I also needed to update the custom fields associated with a comment and I discovered that the function update_field () can be used, as in other cases. In the case of comments, however, it is necessary to pass the object and not the ID, as in this example.
<?php
update_field( 'field_5a46bb8740511', $value, get_comment($comment_id) );
?>
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.