Arguments
Name | Type | Default | Description |
---|
id | string | | A unique ID. This ID will be used to get the value |
type | string | border | 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 | | | |
top_icon | string | top-icon | Display icon/text on the top of the field |
right_icon | string | right-icon | Display icon/text on the right of the field |
bottom-icon | string | bottom-icon | Display icon/text on the bottom of the field |
left_icon | string | left-icon | Display icon/text on the left of the field |
all_icon | string | all-icon | Display icon/text on all the corners of the field |
top | bool | true | Flag to display top of the field |
right | bool | true | Flag to display right of the field |
bottom | bool | true | Flag to display bottom of the field |
left | bool | true | Flag to display left of the field |
color | bool | true | Flag to display color of the field |
style | bool | true | Flag to display style of the field |
all | bool | false | Flag to display all corners of the field |
unit | string | px | Unit to display on the border inputs, also sets output CSS property unit value |
output | array|string | | CSS elements selector |
output_important | bool | false | Flag to add !important rule to output css |
Default Arguments
Name | Type | Description |
---|
top | number | Numeric representing the default top field value |
right | number | Numeric representing the default right field value |
bottom | number | Numeric representing the default bottom field value |
left | number | Numeric representing the default left field value |
all | number | Numeric representing the default all field value |
color | string | String representing the default color value ( #ffbc00, rgba(255,0,0,0.25) ) |
style | string | String representing the default style value ( solid dashed dotted double none ) |
unit | string | String representing the default unit value (px em %) |
Basic Border Example
array(
'id' => 'example-border',
'type' => 'border',
'title' => 'Example Border',
),
Border Field Example with Defaults
array(
'id' => 'example-border',
'type' => 'border',
'title' => 'Border',
'default' => array(
'top' => '4',
'right' => '8',
'bottom' => '4',
'left' => '8',
'style' => 'dashed',
'color' => '#1e73be',
'unit' => 'px',
),
),
Border Field Example with All Options
array(
'id' => 'example-border',
'type' => 'border',
'title' => 'Example Border',
'all' => true,
),
Border Field Example with Customizations
// without top and bottom borders
array(
'id' => 'example-border'
'type' => 'border',
'title' => 'Example Border',
'top' => false,
'bottom' => false,
),
Border Field Example with Custom Outputs
array(
'id' => 'example-border-1',
'type' => 'border',
'title' => 'Example Border 1',
'output' => '.heading',
),
array(
'id' => 'example-border-2',
'type' => 'border',
'title' => 'Example Border 2',
'output' => array('.header-area', '.footer-area'),
),