Support

Account

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/