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

Slider Field

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value.
typestringsliderType of 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   
maxnumber100Value to set the maximum slider value
minnumber0Value to set the minimum slider value
stepnumber1Amount of increment value for each step
unitstringpxUnit to display of the field, also sets output CSS property unit value
outputarray|string CSS elements selector
output_modestring Output CSS property of an element
output_importantboolfalseFlag 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

How can we help?