Field reference
Gallery field
An ordered list of Media Library images.
#Field definition
Add this array inside a block, field group, or option page fields list.
['field_key' => 'gallery', 'label' => 'Gallery', 'type' => 'gallery']#Saved value
| Property | Value |
|---|---|
| Field type | gallery |
| PHP / REST value | object[] |
| Empty value | [] |
#Rendering example
Read block fields from $attributes. Post fields use voxycure_get_field(); option fields use voxycure_get_option().
foreach ((array) ($attributes['gallery'] ?? []) as $image) {
echo wp_get_attachment_image((int) $image['id'], 'large');
}#Common field options
| Key | Type | Purpose |
|---|---|---|
field_key | string | Required unique storage key using lowercase letters, numbers, underscores, or hyphens. |
label | string | Human-readable editor label. |
default_value | mixed | Value used before content is saved. Match the field value type. |
required | boolean | Rejects an empty option-page submission. |
conditional_logic | array | Controls editor visibility based on another field. |
location | string | default or inspector for block fields. |