1) This solution caused problems….. If I do this all my ACF forms are pre-filled from that moment on. So need another way….
2) Looks fine so far
Any suggestions?
@naveen009 @Elliot I did below, but still auto populate?
acf_form(array(
'post_id' => "new",
'field_groups' => array(1677),
'submit_value' => "Versturen en nog één toevoegen",
'updated_message' => false,
'form' => true,
'form_attributes' => array('autocomplete' => "off"),
));
The form element has the autocomplete = “off”…
<form id="post" class="acf-form" action="" method="post" autocomplete="off">
UPDATE: For some reason I interupted the procedure of acf_form to save a post. I think this inserted some values in the DB which caused the problems in all my ACF forms. I deleted the DB and put an old DB from yesterday back and problems solved. Still need to find a way how to solve this now: http://support.advancedcustomfields.com/forums/topic/acf_form-stop-executing-and-return-error/
1) To stop the form from executing I just didn’t run the wp_insert_post() if there was an error.
2) I returned a message like this:
$_POST['return'] = add_query_arg( array('post_id' => $post_id, 'message' => $message), $_POST['return'] );
For sure there are better ways, but so far this is how is solved it.