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

Palette Field

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringpaletteType 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   
optionsarray An array of object containing key/array(colors) pairs representing the options

Palette Field Example

array(
  'id' => 'example-palette',
  'type' => 'palette',
  'title' => 'Palette',
  'options' => array(
    'set1'  => array( '#f04e36', '#f36e27', '#f3d430', '#ed1683' ),
    'set2'  => array( '#f9ca06', '#b5b546', '#2f4d48', '#212b2f' ),
    'set3'  => array( '#4153ab', '#6e86c7', '#211f27', '#d69762' ),
    'set4'  => array( '#162526', '#508486', '#C8C6CE', '#B45F1A' ),
    'set5'  => array( '#bbd5ff', '#ccab5e', '#fff55f', '#197c5d' ),
  ),
  'default' => 'set3',
),
Was this article helpful to you? Yes No

How can we help?