Home Forums Front-end Issues acf_form to retrieve nested fields Reply To: acf_form to retrieve nested fields

  • Looks like your not the only one not getting notifications, I did not get a notification that you replied. Sorry if this left you hanging.

    anyway. If you wanted to target only the last row of a repeater, or any row. I would to this using get_post_meta() instead of ACF functions.

    $repeater = 'repeater_field_name';
    $sub_field = 'sub_field_name';
    $repeater_count = intval(get_post_meta($post_id, $repeater, true);
    if ($repeater_count) {
      $last_row = $repeater_count - 1;
      $value = get_post_meta($post_id, $repeater.'_'.$last_row.'_'.$sub_field, true);
      // $value holds the value of the sub field of the last row