Url
The url
lets you add a url field.

Parameters
Here are the parameters in adding url
.
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.
Note: default value must be provided with a valid url.
priority
integer | optional
determines the order of fields in section.
placeholder
string | optional
display placeholder in the control.
Example
Yano::field( 'url', [
'id' => 'urldb1',
'label' => 'Enter URL',
'description' => 'Some description.',
'section' => 'section_id',
'priority' => 1,
'placeholder' => 'Enter Your URL'
] );
Example with default
value! note: default value must be a valid url
.
Yano::field( 'url', [
'id' => 'urldb1',
'label' => 'Enter URL',
'description' => 'Some description.',
'section' => 'section_id',
'default' => 'https://www.facebook.com',
'priority' => 1,
'placeholder' => 'Enter Your URL'
] );
Usage
The get_theme_mod()
function is recommended to retrieve data.
// Returns a string
echo get_theme_mod('urldb1');