1. Home
  2. Docs
  3. WordPress Studio Framework
  4. Framework Fields
  5. Upload Field

Upload Field

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringuploadType of the field
titlestring Title of the field
defaultstring Default value from database, if the option doesn’t exist
subtitlestring Subtitle to display below the title
descstring Description to display after the field
helpstring Text to display on right-corner (as hover/popup) the field
classstring Extra CSS classes (space separated) to append to the field
beforestring Content to display before the field
afterstring Content to display after the field
dependencyarray Define field visibility depending on other field value
attributesarray Extra HTML attributes to append to the field
sanitizestring Callback function for sanitizing value
validatestring Callback function for validating value
EXTRAS   
libraryarray|stringallTell the modal to show specific formats (image, video, both)
placeholderstring Placeholder to be displayed when nothing is selected
button_titlestringUploadText to display on the upload button
remove_titlestringRemoveText to display on the remove button

Simple Upload Field Example

array(
  'id' => 'example-upload',
  'type' => 'upload',
  'title' => 'Upload',
),

Upload Field Example using Only Images

array(
  'id' => 'example-upload',
  'type' => 'upload',
  'title' => 'Upload',
  'library' => 'image',
  'placeholder' => 'https://',
  'button_title' => 'Add Image',
  'remove_title' => 'Remove Image',
),
Was this article helpful to you? Yes No

How can we help?