Skip to content

Text Family

The text family covers everything that takes a string. Format-specific variants (email, url) add HTML5 validation; password masks input; hidden round-trips a value without rendering anything.

TypeDescriptionStored as
textSingle-line text inputstring
emailEmail with format validationstring
urlURL with format validationstring
passwordMasked inputstring
textareaMulti-line textstring
hiddenNot rendered, just round-trips a saved valuestring
ArgApplies toDefaultNotes
placeholdertext, textarea''Greyed-out hint text shown when empty.
rowstextarea3Number of visible rows.
readonlytext familyfalseRender the input disabled. Same effect as RBAC view-only mode.
copyabletext familyfalseShow a copy-to-clipboard button at the right of the input.
[
'id' => 'api_key',
'type' => 'text',
'label' => __('API key', 'my-plugin'),
'description' => __('Paste into your client app. Treat as a secret.', 'my-plugin'),
'columns' => 12,
'args' => [
'readonly' => true,
'copyable' => true,
],
],
[
'id' => 'tagline',
'type' => 'textarea',
'label' => __('Tagline', 'my-plugin'),
'default' => 'The friendliest newsletter tool on the internet.',
'args' => [
'rows' => 2,
'placeholder' => __('One sentence about your product.', 'my-plugin'),
],
],