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?
<?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(); ?>
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>
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
Helping others is a great way to earn karma, gain badges and help ACF development!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.