I’m using custom template for user to submit posts via the front end but one more duplicate post created after submitting a form. For example if i submit a post with title ‘My article’, another duplicate post with slug ‘my-article-2’ was also created. My code is as follows
<?php
/**
* Template Name: Custom Template
*/
acf_form_head();
get_header();
acf_form(array(
‘post_id’ => ‘new_post’,
‘post_title’ => true,
‘new_post’ => array(
‘post_type’ => ‘article’,
‘post_status’ => ‘publish’
),
‘submit_value’ => ‘Submit’,
‘return’ => ‘%post_url%’,
‘wrap_field_groups’ => false,
‘updated_message’ => ‘Saved!’
));
get_footer();
How to stop re submitting a form in this case?
Hi @sujan_shrestha
Are you stil having an issue with the form?
You code looks just fine.
If you are stil stuck, kindly open a personalised ticket at [email protected]