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
Ok, thank you.
I came up with a new solution just to count the number of values inside the two arrays:
add_action('acf/save_post', 'my_project_updated_send_email_custom', 10);
function my_project_updated_send_email_custom( $post_ID ) {
/* new and old field value */
$dokumenteOld = get_field('field_5ba11346c0289', $post->ID);
$dokumenteNew = '';
if (isset($_POST['acf']['field_5ba11346c0289'])) {
$dokumenteNew = $_POST['acf']['field_5ba11346c0289'];
}
/* get elements in array */
$countOld = count($dokumenteOld);
$countNew = count($dokumenteNew);
}
Now the problem is that both containt the same number of values when i a add a new line in the repeater field (the new count). I also can see the new value in both arrays.
Sorry, this is the last quesiton i ask i promise. Thank you so much for your help!
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.