# Link Color
With the Link Color field, setting the hyperlink properties in a project is as east as selecting the desired colors.
Table of Contents
# Arguments
Name | Type | Default | Description |
---|---|---|---|
type | string | link_color | Value identifying the field type. |
regular | bool | true | Flag to display the regular hyperlink color picker. |
hover | bool | true | Flag to display the hover hyperlink color picker. |
visited | bool | true | Flag to display the visited hyperlink color picker. |
active | bool | true | Flag to display the active hyperlink color picker. |
color_alpha | bool | false | Flag to set the color picker to accept an alpha value. |
Also See
# Default Options
Name | Type | Description |
---|---|---|
regular | string | Hex string for the default regular hyperlink color. |
hover | string | Hex string for the default hover hyperlink color. |
active | string | Hex string for the default active hyperlink color. |
visited | string | Hex string for the default visited hyperlink color. |
# Build Config
Build a Custom Configuration →
Changes you make to this form will be reflected in the generated code.
Redux::set_field( 'OPT_NAME', 'SECTION_ID', array(
'type' => 'link-color'
) );
# Example Config
Redux::set_field(
'OPT_NAME',
'SECTION_ID',
array(
'id' => 'opt-link-color',
'type' => 'link_color',
'title' => esc_html__('Links Color Option', 'your-textdomain-here'),
'subtitle' => esc_html__('Only color validation can be done on this field type', 'your-textdomain-here'),
'desc' => esc_html__('This is the description field, again good for additional info.', 'your-textdomain-here'),
'default' => array(
'regular' => '#1e73be', // blue
'hover' => '#dd3333', // red
'active' => '#8224e3', // purple
'visited' => '#8224e3', // purple
)
)
);
# Example Usage
This example is based on the example usage provided above. Be sure to change $redux_demo
to the value you specified in your opt_name argument.
global $redux_demo;
echo 'Regular color value: ' . $redux_demo['opt-link-color']['regular'];
echo 'Hover color value: ' . $redux_demo['opt-link-color']['hover'];
echo 'Active color value: ' . $redux_demo['opt-link-color']['active'];
echo 'Visited color value: ' . $redux_demo['opt-link-color']['visited'];