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
Last week, we released ACF 5.10 🎉 This update includes the brand new HTML escaping feature, which helps to keep your ACF-generated content safe. Learn about this and other new goodies in the release post: https://t.co/p9gKUYmdDQ