Support

Account

Home Forums Backend Issues (wp-admin) Repeater field returning repeater count until post is saved via admin screen Reply To: Repeater field returning repeater count until post is saved via admin screen

  • Dumping out the meta_data for one of these post reveals that when the post is saved via the admin save button, it has a [_primary] => array ([0] => field_key).

    When dumping out the meta for a post that has only had its repeater field sub fields saved, it is missing the [_primary] key in the meta array.

    I guess I maybe able to resolve this (glitch, bug, or miss understanding of how ACF update_sub_field() works) by adding that meta value and array with key, programatically.

    FIXED
    Add this after the update_sub_field() function is called appears to fix this issue.

    
    update_post_meta($submission_id, '_primary','field_559eee03f62d2');
    

    The repeater name is “primary” and ACF needs the “_primary” meta to hold the “primary” field key ID. It would be nice if this was done via update_sub_field() but apparently it isn’t.