Hello
1.
When the client saves a post through the form generated by the function “acf_form()” the acf saves two equal posts, does anyone know how to resolve this?
follow code:
<?php /* Template Name: Publicar RELPREV */ ?>
<?php
acf_form_head();
get_header();
include(dirname(__DIR__).'/googleFrontEnd.php');
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
acf_form(array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'relprev',
'post_status' => 'publish'
),
'post_title'=> true,
'fields' => array(
'data_e_hora',
'autor_do_relato',
'e-mail_do_autor_do_relato',
'telefone_do_autor_do_relato',
'local',
'empresas_envolvidas',
'aeronaves_envolvidas',
'veiculosequipamentos_envolvidos',
'perigo_observado'
),
'return' => '%post_url%',
'submit_value' => 'Enviar Relato'
));
?>
</main><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
2.
I would also like to ask if the dateTime fields can be displayed with a picker as it happens in the register by the administration page.
The dateTime problem was solved, it was the ‘Fast Velocity Minify’ plugin that was in trouble. We only get the problem of the post being saved in duplicity
The solution is here: https://support.advancedcustomfields.com/forums/topic/acf_form-always-creates-two-posts/#post-51711
<?php wp_footer(); ?> need to be before </body>
The topic ‘acf_form() Creates duplicate posts’ is closed to new replies.
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.