PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.0.13
Kirki – Freeform Page Builder, Website Builder & Customizer v6.0.13
6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / customizer / packages / controls / checkbox / src / Control / Checkbox.php
kirki / customizer / packages / controls / checkbox / src / Control Last commit date
Checkbox.php 3 months ago Checkbox_Switch.php 3 months ago Checkbox_Toggle.php 5 months ago
Checkbox.php
83 lines
1 <?php
2 /**
3 * Customizer Control: checkbox.
4 *
5 * Creates a new custom control.
6 * Custom controls contains all background-related options.
7 *
8 * @package kirki-framework/control-checkbox
9 * @copyright Copyright (c) 2023, Themeum
10 * @license https://opensource.org/licenses/MIT
11 * @since 1.0
12 */
13
14 namespace Kirki\Control;
15
16 use Kirki\Control\Base;
17 use Kirki\URL;
18
19 /**
20 * Adds a checkbox control.
21 *
22 * @since 1.0
23 */
24 class Checkbox extends Base {
25
26 /**
27 * The control type.
28 *
29 * @access public
30 * @since 1.0
31 * @var string
32 */
33 public $type = 'kirki-checkbox';
34
35 /**
36 * The control version.
37 *
38 * @static
39 * @access public
40 * @since 1.0
41 * @var string
42 */
43 public static $control_ver = '1.0.3';
44
45 /**
46 * Enqueue control related scripts/styles.
47 *
48 * @access public
49 * @since 1.0
50 * @return void
51 */
52
53
54 /**
55 * An Underscore (JS) template for this control's content (but not its container).
56 *
57 * Class variables for this control class are available in the `data` JS object;
58 * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
59 *
60 * @see WP_Customize_Control::print_template()
61 *
62 * @access protected
63 * @since 1.0
64 * @return void
65 */
66 protected function content_template() {
67 ?>
68 <input
69 id="_customize-input-{{ data.id }}"
70 type="checkbox"
71 value="{{ data.value }}"
72 {{{ data.link }}}
73 <# if ( data.description ) { #>aria-describedby="_customize-description-{{ data.id }}"<# } #>
74 <# if ( data.value ) { #>checked="checked"<# } #>
75 />
76 <label for="_customize-input-{{ data.id }}">{{{ data.label }}}</label>
77 <# if ( data.description ) { #>
78 <span id="_customize-description-{{ data.id }}" class="description customize-control-description">{{{ data.description }}}</span>
79 <# } #>
80 <?php
81 }
82 }
83