Field reference

Link button field

A paired button label and destination URL.

#Field definition

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

PHP
['field_key' => 'primary_cta', 'label' => 'Primary action', 'type' => 'link_button', 'default_value' => ['text' => 'Learn more', 'url' => '/about/']]

#Saved value

PropertyValue
Field typelink_button
PHP / REST valueobject
Empty value"" or the configured default

#Rendering example

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

PHP
$link = $attributes['primary_cta'] ?? [];
printf('<a href="%s">%s</a>', esc_url($link['url'] ?? ''), esc_html($link['text'] ?? ''));

#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