Leave a Reply

1 comment

  1. Edit – This answer is no longer accurate for the current version of ACF, see their documentation

    Use the acf_save_post hook.

    function my_acf_save_post( $post_id )
    {
        // vars
        $fields = false;
    
        // load from post
        if( isset($_POST['fields']) )
        {
            $fields = $_POST['fields'];
        }
    
        // ...
    }
    
    // run before ACF saves the $_POST['fields'] data
    add_action('acf_save_post', 'my_acf_save_post', 1);
    
    // run after ACF saves the $_POST['fields'] data
    add_action('acf_save_post', 'my_acf_save_post', 20);