Attributes
Name | Type | Default | Description |
---|
id | string | | A unique ID. This ID will be used to get the value |
type | string | link_color | Type of the field |
title | string | | Title of the field |
default | array | | Default value from database, if the option doesn’t exist |
subtitle | string | | Subtitle to display below the title |
desc | string | | Description to display after the field |
help | string | | Text to display on right-corner (as hover/popup) of the field |
class | string | | Extra CSS classes (space separated) to append to the field |
before | string | | Content to display before the field |
after | string | | Content to display after the field |
dependency | array | | Define field visibility depending on other field value |
attributes | array | | Extra HTML attributes to append to the field |
sanitize | string | | Callback function for sanitizing value |
validate | string | | Callback function for validating value |
EXTRAS | | | |
color | bool | true | Flag to display color of the field. (normal, unvisited link) |
hover | bool | true | Flag to display hover of the field. (link when the user mouses over it) |
visited | bool | false | Flag to display visited of the field. (link the user has visited) |
active | bool | false | Flag to display active of the field. (link the moment it is clicked) |
focus | bool | false | Flag to display focus of the field. (link the focus) |
output | array|string | | CSS elements selector |
output_important | bool | false | Flag to add !important rule on output css |
Default Arguments
Name | Type | Description |
---|
color | string | String representing the default color value (#1e73be , rgba(255,0,0,0.25 )) |
hover | string | String representing the default hover color value ( #259ded , rgba(165,125,0,0.25) ) |
visited | string | String representing the default visited color value. #2980b9 , rgba(128,128,0,0.25) |
active | string | String representing the default active color value. #d35400 , rgba(152,55,25,0.25) |
focus | string | String representing the default focus color value. #2c3e50 , rgba(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