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

Border Field

Arguments

NameTypeDefaultDescription
idstring A unique ID. This ID will be used to get the value
typestringborderType 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   
top_iconstringtop-iconDisplay icon/text on the top of the field
right_iconstringright-iconDisplay icon/text on the right of the field
bottom-iconstringbottom-iconDisplay icon/text on the bottom of the field
left_iconstringleft-iconDisplay icon/text on the left of the field
all_iconstringall-iconDisplay icon/text on all the corners of the field
topbooltrueFlag to display top of the field
rightbooltrueFlag to display right of the field
bottombooltrueFlag to display bottom of the field
leftbooltrueFlag to display left of the field
colorbooltrueFlag to display color of the field
stylebooltrueFlag to display style of the field
allboolfalseFlag to display all corners of the field
unitstringpxUnit to display on the border inputs, also sets output CSS property unit value
outputarray|string CSS elements selector
output_importantboolfalseFlag to add !important rule to output css

Default Arguments

NameTypeDescription
topnumberNumeric representing the default top field value
rightnumberNumeric representing the default right field value
bottomnumberNumeric representing the default bottom field value
leftnumberNumeric representing the default left field value
allnumberNumeric representing the default all field value
colorstringString representing the default color value ( #ffbc00, rgba(255,0,0,0.25) )
stylestringString representing the default style value ( solid dashed dotted double none )
unitstringString 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'),
),
Was this article helpful to you? Yes No

How can we help?