-
Notifications
You must be signed in to change notification settings - Fork 2
Control: Switch
Ale Mostajo edited this page Apr 9, 2020
·
1 revision
Control used as a field type to display a on/off switch.
// Namespace and use statement...
class Settings extends Model
{
// Class properties...
protected function init()
{
// Other properties...
$this->tabs = [
'tab_id' => [
'fields' => [
'field_id' => [
'type' => 'switch',
'title' => __( 'Switch', 'my-domain' ),
'default' => true,
],
'is_on' => [
'type' => 'switch',
'title' => __( 'Switch 2', 'my-domain' ),
'description' => __( 'On / Off switch.' ),
'default' => false,
],
// Other fields...
],
],
];
}
}(c) 2020 10 Quality Studio.
