A Border Input Field
Parameter | Type | Value |
---|---|---|
type | required |
Predefined String (border) |
title | optional |
String |
desc | optional |
String |
std | optional |
Array |
selector | optional |
String / Array |
tab | optional |
String(style) |
section | optional |
String |
Always return object
'addon_border' => array(
'type' => 'border',
'title' => __('Border Field','your-textdomain'),
'std' => array(
'borderWidth' => array( 'top' => '0px', 'right' => '0px', 'bottom' => '0px', 'left' => '0px' ),
'borderStyle' =>'solid',
'borderColor' => '#cccccc'
),
'selector' => '{{SELECTOR}} .example-border'
)
Support 'selector' parameters.
Inside the rander()
method-
echo '<div>'.$data["settings"]["addon_border."]["borderWidth"]["top"].'</div>';
echo '<div>'.$data["settings"]["addon_border."]["borderStyle"].'</div>';
echo '<div>'.$data["settings"]["addon_border."]["borderColor"].'</div>';
echo '<div class="example-border">Example Border</div>';
Inside the getTemplate()
method-
<div>{{data.addon_border.borderWidth.top}}</div>
<div>{{data.addon_border.borderStyle}}</div>
<div>{{data.addon_border.borderColor}}</div>
<div class="example-border">Example Border</div>