I
I
Ivan K2021-09-28 09:42:26
WordPress
Ivan K, 2021-09-28 09:42:26

Why does acf_form create 2 records at once?

Hello. Made a form in the template for adding reviews to the site.
Working domain trimedia.isp.regruhosting.ru/testimonial for understanding
This is the archive page of the "reviews" post type. Under it, a separate template made archive-testimonial.php.
Accordingly, as written in the manual, before get_header I call acf_form_head ();
The form itself is in my popup, and its code is in the footer.php template, here is the code:

acf_form(array(
   'post_id' => 'new_post',
   'post_title' => true,
   'new_post' => array(
        'post_type' => 'testimonial',
        'post_status' => 'draft'
   ),
   'return' => home_url('thank-you'),
   'submit_value' => 'оставить отзыв'    
));

Everything seems to be correct. But when sending, 2 entries are immediately created in the admin panel:
6152b9cc65064294912425.png
Google and did not find anything about this, in all the videos that I watched on this topic - they still do everything exactly at the output - one entry is obtained. Tell me where to dig...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question