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
Hi @et3rnal
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:
https://codex.wordpress.org/Function_Reference/wp_update_post
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:
http://www.advancedcustomfields.com/resources/acf_form/
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.