Home › Forums › Add-ons › Gallery Field › Gallery in Frontend form not restricting to post library › Reply To: Gallery in Frontend form not restricting to post library
Hi
I recently observed the same problem when I was using acf_form() with the 'post_id' => 'new_post'
setting.
For me, the solution was to first create an 'auto-draft'
post and then run the acf_form() on this posts’s ID:
$thePostId = wp_insert_post( array('post_title' => 'Temporary Post Title','post_status' => 'auto-draft') );
acf_form(array(
'post_id' => $thePostId,
...
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.