-
-
Notifications
You must be signed in to change notification settings - Fork 413
Expand file tree
/
Copy pathCheckbox.php
More file actions
82 lines (74 loc) · 1.74 KB
/
Checkbox.php
File metadata and controls
82 lines (74 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* Customizer Control: checkbox.
*
* Creates a new custom control.
* Custom controls contains all background-related options.
*
* @package kirki-framework/control-checkbox
* @copyright Copyright (c) 2023, Themeum
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/
namespace Kirki\Control;
use Kirki\Control\Base;
use Kirki\URL;
/**
* Adds a checkbox control.
*
* @since 1.0
*/
class Checkbox extends Base {
/**
* The control type.
*
* @access public
* @since 1.0
* @var string
*/
public $type = 'kirki-checkbox';
/**
* The control version.
*
* @static
* @access public
* @since 1.0
* @var string
*/
public static $control_ver = '1.0.3';
/**
* Enqueue control related scripts/styles.
*
* @access public
* @since 1.0
* @return void
*/
/**
* An Underscore (JS) template for this control's content (but not its container).
*
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Control::to_json()}.
*
* @see WP_Customize_Control::print_template()
*
* @access protected
* @since 1.0
* @return void
*/
protected function content_template() {
?>
<input
id="_customize-input-{{ data.id }}"
type="checkbox"
value="{{ data.value }}"
{{{ data.link }}}
<# if ( data.description ) { #>aria-describedby="_customize-description-{{ data.id }}"<# } #>
<# if ( data.value ) { #>checked="checked"<# } #>
/>
<label for="_customize-input-{{ data.id }}">{{{ data.label }}}</label>
<# if ( data.description ) { #>
<span id="_customize-description-{{ data.id }}" class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<?php
}
}