Home Forums ACF PRO repeater or group child/sub fields issue


repeater or group child/sub fields issue

  • Hi,
    i have latest version of acf pro = 5.8.11, wp = 5.4.1 issue is that some fields i have which admin we can edit as admin and soem fields user fill up in frontend but issue is that if we are trying to update from frontend than those changes do not display on backend and vice versa.
    check video

    here is my code

    <?php // loop through the rows of data
    while (have_rows('legal_requirements')) : the_row();
    if (have_rows('death_registration')) : //child group field
    while (have_rows('death_registration')) : the_row();
    // display a sub field value
    echo '<tr class="d-flex"><td class="col-5">';
    echo '</td>'; ?>
    <td class="col-3">
    <?php the_sub_field('registration-to-do');
    echo '</td>';
    echo '<td class="col-3">';
    echo '</td>'; ?>
    <td class="col-1"><?php
    $todooptions = array(
    'fields' => array(
    'form' => true
    // 'submit_value' => 'Save Cost'
    acf_form($todooptions); ?></td>
    <?php endwhile; ?>
    <?php endif; ?>
    <?php endwhile;
  • You cannot only include sub fields when using an ACF form. ACF form can only work if the Repeater=>Group=>child fields are all shown and the structure is maintained. When you include only the child fields then ACF assumes that these will be saved at the top level rather than as rows of a repeater.

    To to this you need to build your own form and then build an acf/save_post filter that takes the values submitted and updates the fields correctly.

  • hi, should i use acf_form(); too while calling fields into single post template

    $options = array(
                                                'fields' => array(
                                                'form' => true,
                                                // 'submit_value'    => 'Save Cost'

    i have tried to add save_post action but it is not working not saving any values

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

The topic ‘repeater or group child/sub fields issue’ is closed to new replies.