Home › Forums › General Issues › How to update a field in a query › Reply To: How to update a field in a query
Curious.. when you are using get_field and $post_id is that working as expected? Might need to change $post_id to get_the_id()??
At any rate…
Can you make these changes for testing, and let me know how it goes?
function rto_deactivation($id) {
update_field('field_59ba2159ddd3b', 'Deactive', $id);
}
// then call it like:
rto_deactivation( get_the_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.