Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 895 Bytes

Text.md

File metadata and controls

42 lines (36 loc) · 895 Bytes

Text

A text input field.

Parameters

Parameter Type Value
type required Predefined String (text)
title optional String
desc optional String
placeholder optional String
std optional String
selector optional String (better not to use)
tab optional String(style)
section optional String

Return

Always return string

Example

'addon_text' => array(
    'type' => 'text',
    'title' => __('Text Field','your-textdomain'),
    'placeholder' => __('Text Placeholder','your-textdomain'),
    'std' => 'Default Value of Text',
)

Support 'selector' parameters but it's better not to use the selector.

Controls

PHP

Inside the rander() method-

echo '<div>'.$data['settings']['addon_text'].'</div>';

JS Template

Inside the getTemplate() method-

<div>{{data.addon_text}}</div>