I am using ajax to create a new post and all works fine. However i am not able to update any ACF fields as they are undefined initially. The only way i can resolve it is to go into the back end and hit update manually on the post. On doing so the ACF content becomes available to access from the front end and so updateable.
I’ve tried adding each of the below in the create post function to see if it might help, but no such luck:
do_action( ‘acf/save_post’, $new_post_id );
update_post_meta( $new_post_id );
wp_update_post( $new_post_id );
Anyone have ideas how to overcome this problem programatically?
Thanks in advance