Home › Forums › Front-end Issues › Updating the post_status causing problem in the backend › Reply To: Updating the post_status causing problem in the backend
I think that what you’re experiencing is the classic infinite loop problem.
You hook into the saving of a post and in that function you save the post again thus calling the function over and over (and over and over).
There’s information here about the issue and how to solve it:
Also, in your second function why are you calling
//Save the fields to the post
do_action( 'acf/save_post' , $post_id );
It seems like you’re using the old code snippet for creating new posts (I assume you’re doing this with
acf_form()). Make sure you read everything here:
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!