Support

Account

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!