Support

Account

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.