Arguments
Name | Type | Default | Description |
---|
id | string | | A unique ID. This ID will be used to get the value |
type | string | upload | Type of the field |
title | string | | Title of the field |
default | string | | Default value from database, if the option doesn’t exist |
subtitle | string | | Subtitle to display below the title |
desc | string | | Description to display after the field |
help | string | | Text to display on right-corner (as hover/popup) the field |
class | string | | Extra CSS classes (space separated) to append to the field |
before | string | | Content to display before the field |
after | string | | Content to display after the field |
dependency | array | | Define field visibility depending on other field value |
attributes | array | | Extra HTML attributes to append to the field |
sanitize | string | | Callback function for sanitizing value |
validate | string | | Callback function for validating value |
EXTRAS | | | |
library | array|string | all | Tell the modal to show specific formats (image, video, both) |
placeholder | string | | Placeholder to be displayed when nothing is selected |
button_title | string | Upload | Text to display on the upload button |
remove_title | string | Remove | Text 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