Home › Forums › Front-end Issues › Field values not displaying in front-end form › Reply To: Field values not displaying in front-end form
I see what you are saying, but I thought it defaulted to the current post ID. Anyway, my fields are being populated now, whether I add a varible to the ‘post_ID’ or leave it as ‘false’.
The only fields that are not functioning properly are two post object fields in a group. I have tested that group on the form, but commented them out for now. They only display the value that has been selected on the backend.
$post_ID = get_the_ID();
$settings = array(
'id' => 'acf-form',
'post_id' => $post_ID,
'new_post' => false,
'field_groups' => array('group_56f97a1203bfe','group_58b8b6b885fbb'), //'group_57180f67b48be',
// 'fields' => array(),
'post_title' => false,
'post_content' => false,
'form' => true,
/* (array) An array or HTML attributes for the form element */
// 'form_attributes' => array(),
'return' => '',
'html_before_fields' => '',
'html_after_fields' => '',
'submit_value' => __("Update", 'acf'),
'updated_message' => __("Post updated", 'acf'),
'label_placement' => 'top',
'instruction_placement' => 'label',
'field_el' => 'div',
'uploader' => 'wp',
'honeypot' => true,
'html_updated_message' => '<div id="message" class="updated"><p>%s</p></div>',
'html_submit_button' => '<input type="submit" class="acf-button button button-primary button-large" value="%s" />',
'html_submit_spinner' => '<span class="acf-spinner"></span>'
);
acf_form($settings);
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.