Range
The range
lets you add a range field.

Parameters
Here are the parameters in adding range
.
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
integer | optional
the default value of the field.
priority
integer | optional
determines the order of fields in section.
min
integer | required
minimum value set.
max
integer | required
maximum value set.
step
int | optional
stepper value.
Example
Yano::field( 'range', [
'id' => 'rangedb1',
'label' => 'Set Limit Of Visitor',
'description' => 'Limit Number Of Visitor.',
'section' => 'section_id',
'priority' => 1,
'min' => 0,
'max' => 100,
'step' => 1
] );
Example with default
value! note: default value must be numeric.
Yano::field( 'range', [
'id' => 'rangedb1',
'label' => 'Set Limit Of Visitor',
'description' => 'Limit Number Of Visitor.',
'section' => 'section_id',
'default' => 50,
'priority' => 1,
'min' => 0,
'max' => 100,
'step' => 1
] );
Usage
The get_theme_mod()
function is recommended to retrieve data.
// Return a integer
echo get_theme_mod('rangedb1');