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.
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.