Home › Forums › Backend Issues (wp-admin) › How to update true/false field › Reply To: How to update true/false field
Hi @toleanu
The true/false field will save it’s data as either a 1 or a 0. So the code update_field('topic_solved', 1, 4237)
should work correctly.
If the post (4237) does not already contain a value, you must use the field_key instead of the field name, however, it looks like you have already tried this.
Perhaps the code is not running due to a PHP error before it?
Thanks
E
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.