For some reason, my acf field won’t save when we are not logged in. Here is an example on my code:
<?php
acf_form_head();
get_header();
acf_enqueue_uploader();
?>
<style>
section.fusion-tb-header {
display: none;
}
.avada-page-titlebar-wrapper {
display: none;
}
section.fusion-tb-footer.fusion-footer {
display: none;
}
div#wpadminbar{
display: none!important;
}
a#toTop {
display: none;
}
a.acf-button.button {
display: block;
border: solid 1px #c6d6e3;
text-align: center;
background: #c6d6e3;
color: #fff;
}
input.acf-button.button.button-primary.button-large {
background-color: #4a5f77;
border: 0px;
color: #fff;
width: 96%;
font-size: 20px;
font-weight: 600;
text-align: center;
margin: 0 auto;
display: block;
}
</style>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php acf_form(array(
'post_id' => 123,
'field_groups' => array('group_62e4b1a600eab'),
'post_author' => 6,
'kses' => false,
'form_attributes' => array(
'enctype' => 'multipart/form-data',
)
)); ?>
<?php endwhile; ?>
<div class="buffer" style="display: block; height: 600px; width: 100%;"></div>
</main><!-- .site-main -->
</div>
<script src="https://asapwellmind.wpengine.com/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf.min.js?ver=5.11" id="acf-js"></script>
<script src="https://asapwellmind.wpengine.com/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf-input.min.js?ver=5.11" id="acf-input-js"></script>
<script src="https://asapwellmind.wpengine.com/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/pro/acf-pro-input.min.js?ver=5.11" id="acf-pro-input-js"></script>
<script src="https://asapwellmind.wpengine.com/wp-content/plugins/advanced-custom-fields-pro/assets/inc/select2/4/select2.full.min.js?ver=4.0" id="select2-js"></script>
<?php get_footer(); ?>
The data will always be saved to this post
'post_id' => 123,
Is that what you are trying to do?