Home › Forums › Backend Issues (wp-admin) › update_value with image field: same value and old_value › Reply To: update_value with image field: same value and old_value
In this case the “Old Value” is not the value from the DB. Old value would only be different than New Value after another update_value filter change the value. Here Old value means the value that was submitted vs what the value currently is. These will always be the same unless your site has multiple filters that are operating on the field.
If you want to compare the old value in the DB vs the new value submitted then you need to use an acf/save_post action with a priority < 10. $_POST[‘acf’][$field_key] will hold the new value (an ID) and to get the old value you can use get_field('field', $post_id, false)
which will always return the image 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.