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

Icon Field

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringiconType of the field
titlestring Title of the field
defaultarray 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) of 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   
button_titlestringAdd IconText to display on the add button
remove_titlestringRemove IconText to display on the remove button

Simple Icon Field Example

array(
  'id' => 'example-icon',
  'type' => 'icon',
  'title' => 'Example Icon',
),

Icon Field Example with Default

array(
  'id' => 'example-icon',
  'type' => 'icon',
  'title' => 'Example Icon',
  'default' => 'fa fa-heart',
),
Was this article helpful to you? Yes No

How can we help?