Arguments
Name | Type | Default | Description |
---|
id | string | | A unique ID. This ID will be used to get the value. |
type | string | slider | Type of 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 | | | |
max | number | 100 | Value to set the maximum slider value |
min | number | 0 | Value to set the minimum slider value |
step | number | 1 | Amount of increment value for each step |
unit | string | px | Unit to display of the field, also sets output CSS property unit value |
output | array|string | | CSS elements selector |
output_mode | string | | Output CSS property of an element |
output_important | bool | false | Flag to add !important rule on output css |
Simple Slider Field Example
array(
'id' => 'example-slider',
'type' => 'slider',
'title' => 'Slider',
),
Slider Field Example with Defaults
array(
'id' => 'example-slider',
'type' => 'slider',
'title' => 'Slider',
'default' => 50,
),
Slider Field Example with Min-Max
array(
'id' => 'example-slider',
'type' => 'slider',
'title' => 'Slider',
'min' => 0,
'max' => 100,
'step' => 1,
'unit' => 'px',
'default' => 30,
),
Was this article helpful to you?
Yes
No