I’m afraid that’s not possible because acf_form() will save the data when you click the submit button. But you can always set the post to draft so it won’t show up on the site and but you can open the preview. For a new post, you can use this code:
// Rest of the options here
'post_id' => 'new_post',
'new_post' => array(
// Rest of wp_insert_post() options here
'post_status' => 'draft'
If the user is a logged in user, then they should be able to see the preview version of the posts as long as the post author is set to the current user. Unfortunately, I’m not sure how you can get the preview link from a post ID. In this case, could you please ask WordPress community?
If the user is a guest, then I’m afraid this is not possible.
Also, acf_form() needs you to submit the form before it’s saved in the database. Because you need to submit it anyway, I think showing the result page would be an easier thing to do. If your users need to modify the post, you can add a front end form that has this capability so they can update the result.
You can also add extra field to flag the post as “published” or “draft.” That way, you can query posts that are flagged as “published” only.
I hope this makes sense 🙂
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users