1 | <?php |
||
20 | class Kirki_Control_Select extends WP_Customize_Control { |
||
21 | |||
22 | /** |
||
23 | * The control type. |
||
24 | * |
||
25 | * @access public |
||
26 | * @var string |
||
27 | */ |
||
28 | public $type = 'kirki-select'; |
||
29 | |||
30 | /** |
||
31 | * Used to automatically generate all CSS output. |
||
32 | * |
||
33 | * @access public |
||
34 | * @var array |
||
35 | */ |
||
36 | public $output = array(); |
||
37 | |||
38 | /** |
||
39 | * Data type |
||
40 | * |
||
41 | * @access public |
||
42 | * @var string |
||
43 | */ |
||
44 | public $option_type = 'theme_mod'; |
||
45 | |||
46 | /** |
||
47 | * Maximum number of options the user will be able to select. |
||
48 | * Set to 1 for single-select. |
||
49 | * |
||
50 | * @access public |
||
51 | * @var int |
||
52 | */ |
||
53 | public $multiple = 1; |
||
54 | |||
55 | /** |
||
56 | * Enqueue control related scripts/styles. |
||
57 | * |
||
58 | * @access public |
||
59 | */ |
||
60 | public function enqueue() { |
||
66 | |||
67 | /** |
||
68 | * Refresh the parameters passed to the JavaScript via JSON. |
||
69 | * |
||
70 | * @see WP_Customize_Control::to_json() |
||
71 | */ |
||
72 | public function to_json() { |
||
96 | |||
97 | |||
98 | /** |
||
99 | * An Underscore (JS) template for this control's content (but not its container). |
||
100 | * |
||
101 | * Class variables for this control class are available in the `data` JS object; |
||
102 | * export custom variables by overriding {@see WP_Customize_Control::to_json()}. |
||
103 | * |
||
104 | * @see WP_Customize_Control::print_template() |
||
105 | * |
||
106 | * @access protected |
||
107 | */ |
||
108 | protected function content_template() { |
||
142 | |||
143 | |||
144 | /** |
||
145 | * Render the control's content. |
||
146 | * |
||
147 | * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`. |
||
148 | * |
||
149 | * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. |
||
150 | * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. |
||
151 | * |
||
152 | * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template(). |
||
153 | * |
||
154 | * @since 3.0.0 |
||
155 | */ |
||
156 | protected function render_content() {} |
||
157 | } |
||
158 |