Home › Forums › Front-end Issues › Pass new $post_id to url or… › Reply To: Pass new $post_id to url or…
Hi @synergywp
The acf_form function will not create a new post by default. To create a new post, you will need to hook into the pre_save_post filter and create the post there.
Whilst you are inserting the post, you can get the new ID from the code you write.
Then you can modify the $_POST data which contains the redirect url.
Take a look at the docs for examples of creating a new post with the acf form and also read through the source code core/api.php
to se how the acf_form_head function works
Cheers
E
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.