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

Spinner Field

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringspinnerType 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   
maxnumber100Value to set the maximum spinner value
minnumber0Value to set the minimum spinner value
stepnumber1Amount of increment value for each step
unitstringpxThe unit to display of the field, also sets output CSS property unit value
outputarray|string CSS elements selector
output_modestringwidthOutput CSS property of an element (Example: width height max-width)
output_importantboolfalseFlag to add !important rule on output css

Simple Spinner Field Example

array(
  'id' => 'example-spinner',
  'type' => 'spinner',
  'title' => 'Example Spinner',
),

Spinner Field Example with Default

array(
  'id' => 'example-spinner',
  'type' => 'spinner',
  'title' => 'Example Spinner',
  'default' => 50,
),

Spinner Field Example with Specific Settings

array(
  'id' => 'example-spinner',
  'type' => 'spinner',
  'title' => 'Example Spinner',
  'min' => 0,
  'max' => 100,
  'step' => 10,
  'unit' => 'px',
  'default' => 25,
),

Spinner Field Example with Outputs

array(
  'id' => 'example-spinner',
  'type' => 'spinner',
  'title' => 'Example Spinner',
  'min' => 0,
  'max' => 1600,
  'step' => 1,
  'unit' => '%',
  'output' => '.header-area',
  'output_mode' => 'width',
  'default' => 1000,
),
Was this article helpful to you? Yes No

How can we help?