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.
https://www.advancedcustomfields.com/resources/acf-save_post/
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!
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.