PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.1.1
Kirki – Freeform Page Builder, Website Builder & Customizer v6.1.1
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 / custom / src / Control / Custom.php
kirki / customizer / packages / controls / custom / src / Control Last commit date
Custom.php 5 months ago
Custom.php
65 lines
1 <?php
2 /**
3 * Customizer Control: custom.
4 *
5 * Creates a new custom control.
6 * Custom controls accept raw HTML/JS.
7 *
8 * @package kirki-framework/control-custom
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
18 /**
19 * The "custom" control allows you to add any raw HTML.
20 *
21 * @since 1.0
22 */
23 class Custom extends Base {
24
25 /**
26 * The control type.
27 *
28 * @access public
29 * @since 1.0
30 * @var string
31 */
32 public $type = 'kirki-custom';
33
34 /**
35 * An Underscore (JS) template for this control's content (but not its container).
36 *
37 * Class variables for this control class are available in the `data` JS object;
38 * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
39 *
40 * @see WP_Customize_Control::print_template()
41 *
42 * @access protected
43 * @since 1.0
44 * @return void
45 */
46 protected function content_template() {
47 ?>
48 <label>
49 <# if ( data.label ) { #><span class="customize-control-title">{{{ data.label }}}</span><# } #>
50 <# if ( data.description ) { #><span class="description customize-control-description">{{{ data.description }}}</span><# } #>
51 <?php
52 /**
53 * The value is defined by the developer in the field configuration as 'default'.
54 * There is no user input on this field, it's a raw HTML/JS field and we do not sanitize it.
55 * Do not be alarmed, this is not a security issue.
56 * In order for someone to be able to change this they would have to have access to your filesystem.
57 * If that happens, they can change whatever they want anyways. This field is not a concern.
58 */
59 ?>
60 {{{ data.value }}}
61 </label>
62 <?php
63 }
64 }
65