Support

Account

Home Forums ACF PRO acf_form() not working in ACF 5 Reply To: acf_form() not working in ACF 5

  • To use your own pre_save_post filter the value of the “post_id” argument when calling acf_form() must match the id use in the check within your pre_save_post filter.

    If you use the post_id of “new_form” when calling acf_form() then the built in pre_save_post filter will be used and the post ID will be set to a real post ID and the post will already be created before your filter is called. The type of post that is created will be based on the value in the “new_post” argument you use when you call acf_form(), which defaults to “post”.

    If you use the built in method of creating a new post, then you don’t really need your own pre_save_post filter, because the reason to use it is to do things before the post is saved, for example getting the title from a custom acf field and using that to create the new post.