Support

Account

Home Forums Backend Issues (wp-admin) how to detect if post is new or edited with pre_save_post()? Reply To: how to detect if post is new or edited with pre_save_post()?

  • So, looking at that thread, yes, you do need two function. You need an acf/save_post action in the admin and you need an acf/pre_save_post action for dealing with new posts created with acf_form().

    These functions will work together.

    In the admin, only the acf/save_post filter will be used.

    For ACF form, first the acf/pre_save_post filter will be called. This will create the new post of the correct post type and return the post ID. Then a little later on the accf/save_post filter will be called to do all the other stuff that needs to be done.

    Sorry for any confusion.