Home Forums Add-ons Repeater Field acf_form front end isn\'t loading saved data on redirect?


acf_form front end isn\'t loading saved data on redirect?

  • Hello,

    I’m integrating an acf_form into an existing form and everything seems to be working upon saving the data .. my $_POST[‘acf’] is saving properly

    array(1) {
      array(2) {
        array(2) {
          string(12) "adwrerwerwer"
          string(4) "1793"
        array(2) {
          string(11) "ryandennler"
          string(4) "1789"

    and my data is being saved into the database under the option name in wp_options:


    However when it refreshes on the front end after I hit submit, it doesn’t load those saved values.

    This is the form code I’m using to output:

    <?php acf_form(array(
    				'id' => get_the_ID(),
    				'form'  => false
    				)); ?>

    Am I doing this wrong? My goal is to allow people to utilize a repeater field to add multiple lawyers in their law firm to their lawyer listing page. The form I’m using updates all of their post data already and I’m just integrating acf_form into that to apply this one bit of functionality.

    The data saves perfectly fine, the problem seems to be that when it loads acf_form , it’s not applying those saved values to the post I’m trying to update it for and it’s not loading those saved fields into the form so they can modify them in the future. I may be having this all wrong though on how it exactly works considering it’s saving as a wp_options value without a context to the post at all. I mean I thought it would save these values into wp_postmeta with a post context value but it’s just saving it as a static wp_options value.

    Edit: I will add that it seems to save AND load properly on refreshing when updating/publishing the post itself on the backend , it just doesn’t seem to load at all on the front end. I’m thinking I’m just calling acf_form incorrectly and it’s not linking to the post to load the correct values.

    Thanks guys

  • Actually, the acf_form seems to load the values properly only if I’ve saved those values from the backend. It seems the issue is that it simply just doesn’t save to the wp_postmeta table for that post properly so nothing is actually saved , although the data is saved to wp_options instead (confused about this in general) from looking in my database tables and also records the $_POST data to JSON properly upon updating so the culprit seems to lie in the functionality of actually binding the data to the wp_postmeta table.

    Anybody know the hooks utilized in this?


  • I got it figured out , it was actually a theme issue and the way the theme was handling front end submissions. I was able to hook into a custom action hook given by the theme and it worked properly by just hooking acf_save_form(get_the_ID()) into it.

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

You must be logged in to reply to this topic.