Home Forums Backend Issues (wp-admin) acf_form values not displaying in admin, are displaying on front end


acf_form values not displaying in admin, are displaying on front end

  • Hello,

    I am trying to create a front end form using acf_form where the user creates a new post with a custom post type. Right now the form is functioning properly (for the most part).

    				$fields = array(
              // 'field_5d013bc76baec', Date picker not working
              // 'field_5d013c0e6baed', Date picker not working
    					'id'       => 'new-microsite',
    					'post_id'  => 'new_post',
    					'new_post' => array(
    						'post_type'   => 'microsite',
    						'post_status' => 'draft',
    					'post_title'   => true,
    					'post_content' => true,
    					'uploader'     => 'basic',
    					'return'       => home_url('/'),
    					'fields'       => $fields,
    					'submit_value' => 'Submit your Microsite'

    When I call the content <?php the_field('show_name') ?> it displays correctly on the front end. However, the admin doesn’t show any of the submitted values on the post edit screen. Essentially all the custom fields show up as blank, but the front end preview does get the correct data and display it properly.

    Any idea as to why the fields show no values?

    I have acf_form_head(); placed correctly.

    It may be worth noting that the date picker and a WYSIWYG editor are not working properly on the front end, but I think that is a separate issue.

    Thanks for your help!

  • Okay, realized there were lots of console errors that were most likely related to this (it’s what was causing the date picker issue among others)

    Noticed that if I switched the order of

    <?php acf_form_head(); ?>
    <?php get_header(); ?>


    <?php get_header(); ?>
    <?php acf_form_head(); ?>

    based on this

    This caused an issue on submit as mentioned.

    So, I added

      acf_form_head();  // <--- here!
      echo ob_get_clean();

    Now the info appears in the admin correctly after submit…but doesn’t display correctly on the front end.

    To be continued.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.