PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.1.0
Kirki – Freeform Page Builder, Website Builder & Customizer v6.1.0
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 / radio / src / Control / Radio_Buttonset.php
kirki / customizer / packages / controls / radio / src / Control Last commit date
Radio.php 3 months ago Radio_Buttonset.php 3 months ago Radio_Image.php 3 months ago
Radio_Buttonset.php
68 lines
1 <?php
2 /**
3 * Customizer Control: radio-buttonset.
4 *
5 * @package kirki-framework/control-radio
6 * @copyright Copyright (c) 2023, Themeum
7 * @license https://opensource.org/licenses/MIT
8 * @since 1.0
9 */
10
11 namespace Kirki\Control;
12
13 use Kirki\Control\Base;
14 use Kirki\Control\Radio;
15 use Kirki\URL;
16
17 /**
18 * Radio Buttonset control (modified radio)
19 *
20 * @since 1.0
21 */
22 class Radio_Buttonset extends Base {
23
24 /**
25 * The control type.
26 *
27 * @access public
28 * @since 1.0
29 * @var string
30 */
31 public $type = 'kirki-radio-buttonset';
32
33 /**
34 * Enqueue control related scripts/styles.
35 *
36 * @access public
37 * @since 1.0
38 * @return void
39 */
40
41
42 /**
43 * An Underscore (JS) template for this control's content (but not its container).
44 *
45 * Class variables for this control class are available in the `data` JS object;
46 * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
47 *
48 * @see WP_Customize_Control::print_template()
49 *
50 * @access protected
51 * @since 1.0
52 * @return void
53 */
54 protected function content_template() {
55 ?>
56 <# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
57 <# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #>
58 <div id="input_{{ data.id }}" class="buttonset">
59 <# for ( key in data.choices ) { #>
60 <input {{{ data.inputAttrs }}} class="switch-input screen-reader-text" type="radio" value="{{ key }}" name="_customize-radio-{{{ data.id }}}" id="{{ data.id }}{{ key }}" {{{ data.link }}}<# if ( key === data.value ) { #> checked="checked" <# } #>>
61 <label class="switch-label switch-label-<# if ( key === data.value ) { #>on <# } else { #>off<# } #>" for="{{ data.id }}{{ key }}">{{{ data.choices[ key ] }}}</label>
62 </input>
63 <# } #>
64 </div>
65 <?php
66 }
67 }
68