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

Link Color Field

Attributes

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringlink_colorType 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   
colorbooltrueFlag to display color of the field. (normal, unvisited link)
hoverbooltrueFlag to display hover of the field. (link when the user mouses over it)
visitedboolfalseFlag to display visited of the field. (link the user has visited)
activeboolfalseFlag to display active of the field. (link the moment it is clicked)
focusboolfalseFlag to display focus of the field. (link the focus)
outputarray|string CSS elements selector
output_importantboolfalseFlag to add !important rule on output css

Default Arguments

NameTypeDescription
colorstringString representing the default color value (#1e73bergba(255,0,0,0.25))
hoverstringString representing the default hover color value ( #259dedrgba(165,125,0,0.25))
visitedstringString representing the default visited color value.  #2980b9rgba(128,128,0,0.25)
activestringString representing the default active color value. #d35400rgba(152,55,25,0.25)
focusstringString representing the default focus color value.  #2c3e50rgba(55,100,150,0.25)

Simple Link Color Field Example

array(
  'id' => 'example-link-color',
  'type' => 'link_color',
  'title' => 'Link Color Example',
),

Link Color Field Example with Defaults

array(
  'id' => 'example-link-color',
  'type' => 'link_color',
  'title' => 'Link Color Example',
  'default' => array(
    'color' => '#1e73be',
    'hover' => '#259ded',
  ),
),

Link Color Field Example with Full Options

array(
  'id' => 'example-link-color',
  'type' => 'link_color',
  'title' => 'Link Color Example',
  'color' => true,
  'hover' => true,
  'visited' => true,
  'active' => true,
  'focus' => true,
  'default' => array(
    'color' => '#1e73be',
    'hover' => '#259ded',
    'visited' => '#222',
    'active' => '#333',
    'focus' => '#111',
  ),
),

Link Color Field Example with Output

array(
  'id' => 'example-link-color',
  'type' => 'link_color',
  'title' => 'Link Color Example',
  'output' => '.header-area',
  'default' => array(
    'color' => '#1e73be',
    'hover' => '#259ded',
  ),
),

 

Was this article helpful to you? Yes No

How can we help?