function get_row( $format = false ) {
//vars
$loop = acf_get_loop( 'active' );
// bail early if no loop
if ( ! $loop ) {
return false;
}
// get value
$value = acf_maybe_get( $loop['value'], $loop['i'] );
// bail early if no current value
// possible if get_row_layout() is called before the_row()
if ( ! $value ) {
return false;
}
// format
if ($format) {
//vars
$field = $loop['field'];
// single row
if ( acf_get_field_type_prop( $field['type'], 'have_rows' ) === 'single' ) {
// format value
$value = acf_format_value( $value, $loop['post_id'], $field );
// multiple rows
} else {
// format entire value
// - solves problem where cached value is incomplete
// - no performance issues here thanks to cache
$value = acf_format_value( $loop['value'], $loop['post_id'], $field );
$value = acf_maybe_get( $value, $loop['i'] );
}
}
// return
return $value;
}