Field reference

Repeater field

A repeatable list of rows with a defined child-field schema.

#Field definition

Add this array inside a block, field group, or option page fields list.

PHP
['field_key' => 'stats', 'label' => 'Statistics', 'type' => 'repeater', 'fields' => [['field_key' => 'value', 'label' => 'Value', 'type' => 'text'], ['field_key' => 'label', 'label' => 'Label', 'type' => 'text']]]

#Saved value

PropertyValue
Field typerepeater
PHP / REST valueobject[]
Empty value[]

#Rendering example

Read block fields from $attributes. Post fields use voxycure_get_field(); option fields use voxycure_get_option().

PHP
foreach ((array) ($attributes['stats'] ?? []) as $row) {
    printf('<strong>%s</strong><span>%s</span>', esc_html($row['value'] ?? ''), esc_html($row['label'] ?? ''));
}

#Common field options

KeyTypePurpose
field_keystringRequired unique storage key using lowercase letters, numbers, underscores, or hyphens.
labelstringHuman-readable editor label.
default_valuemixedValue used before content is saved. Match the field value type.
requiredbooleanRejects an empty option-page submission.
conditional_logicarrayControls editor visibility based on another field.
locationstringdefault or inspector for block fields.
Framework version2.0.0
PHP requirement8.0+
Documentation updatedAugust 2026