Support

Account

Home Forums Front-end Issues Get sub field object of field in a group? Reply To: Get sub field object of field in a group?

  • To get the field object of a group field sub field you need to treat the group field as a repeater, not as an array.

    
    while (have_rows('twi_fields')) {
      // always happens once on a group field
      the_row();
      $text = get_sub_field('twi_text');
      $field = get_sub_field_object('twi_text');
      $fieldtype = $field['type'];
    }