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!
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.