Size
The size
lets you add a input field for size.

Parameters
Here are the parameters in adding size
.
id
string | required
a unique slug-like string to use as an id and also as index in saving data in database.
label
string | optional
the label of the field.
description
string | optional
the description of the field and display under the label.
section
string | requiredl
the section where the field will be displayed.
default
string | optional
the default value of the field.
priority
integer | optional
determines the order of fields in section.
units
array | required
list of valid units 'px', 'em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', '%'.
Note: units value must be valid
placeholder
string | optional
this will be display as placeholder.
Example
Yano::field( 'size', [
'id' => 'sizedb1',
'label' => 'Enter Padding Size',
'description' => 'Add size in here.',
'section' => 'section_id',
'priority' => 1,
'placeholder' => 'Enter size',
'units' => [ 'px', 'em' ],
] );
Example of default
value!
Yano::field( 'size', [
'id' => 'sizedb1',
'label' => 'Enter Padding Size',
'description' => 'Add size in here.',
'section' => 'section_id',
'default' => '10px',
'priority' => 1,
'placeholder' => 'Enter size',
'units' => [ 'px', 'em' ],
] );
Usage
The get_theme_mod()
function is recommended to retrieve data.
// Return a string
echo get_theme_mod('sizedb1');