Home › Forums › ACF PRO › Check if field has changed when save to change mail › Reply To: Check if field has changed when save to change mail
To do this you need to set your filter to run on the hook
acf/save_post with a priority <10.
At this point any old values for the custom fields are still in the database and you can compare the values that are submitted with the old values:
$old_value = get_field('your_field_name', $post_id); $new_value = $_POST['acf']['your_field_key'];
You’ll also need to adjust your other function to use the post ID passed to your filter by ACF
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!
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future.— Advanced Custom Fields (@wp_acf) January 6, 2023
© 2023 Advanced Custom Fields.