author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
5 | 3 |
* WordPress Customize Control classes |
0 | 4 |
* |
5 |
* @package WordPress |
|
6 |
* @subpackage Customize |
|
7 |
* @since 3.4.0 |
|
8 |
*/ |
|
5 | 9 |
|
10 |
/** |
|
11 |
* Customize Control class. |
|
12 |
* |
|
13 |
* @since 3.4.0 |
|
14 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
15 |
#[AllowDynamicProperties] |
0 | 16 |
class WP_Customize_Control { |
5 | 17 |
|
18 |
/** |
|
19 |
* Incremented with each new class instantiation, then stored in $instance_number. |
|
20 |
* |
|
21 |
* Used when sorting two instances whose priorities are equal. |
|
22 |
* |
|
23 |
* @since 4.1.0 |
|
24 |
* @var int |
|
25 |
*/ |
|
26 |
protected static $instance_count = 0; |
|
27 |
||
28 |
/** |
|
29 |
* Order in which this instance was created in relation to other instances. |
|
30 |
* |
|
31 |
* @since 4.1.0 |
|
32 |
* @var int |
|
33 |
*/ |
|
34 |
public $instance_number; |
|
35 |
||
0 | 36 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
* Customizer manager. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
38 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
39 |
* @since 3.4.0 |
0 | 40 |
* @var WP_Customize_Manager |
41 |
*/ |
|
42 |
public $manager; |
|
43 |
||
44 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
45 |
* Control ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
46 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
47 |
* @since 3.4.0 |
0 | 48 |
* @var string |
49 |
*/ |
|
50 |
public $id; |
|
51 |
||
52 |
/** |
|
53 |
* All settings tied to the control. |
|
54 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
55 |
* @since 3.4.0 |
0 | 56 |
* @var array |
57 |
*/ |
|
58 |
public $settings; |
|
59 |
||
60 |
/** |
|
61 |
* The primary setting for the control (if there is one). |
|
62 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
63 |
* @since 3.4.0 |
18 | 64 |
* @var string|WP_Customize_Setting|null |
0 | 65 |
*/ |
66 |
public $setting = 'default'; |
|
67 |
||
68 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
69 |
* Capability required to use this control. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
70 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
71 |
* Normally this is empty and the capability is derived from the capabilities |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
72 |
* of the associated `$settings`. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
73 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
74 |
* @since 4.5.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
75 |
* @var string |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
76 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
77 |
public $capability; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
78 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
79 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
80 |
* Order priority to load the control in Customizer. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
81 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
82 |
* @since 3.4.0 |
0 | 83 |
* @var int |
84 |
*/ |
|
5 | 85 |
public $priority = 10; |
0 | 86 |
|
87 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
88 |
* Section the control belongs to. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
89 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
90 |
* @since 3.4.0 |
0 | 91 |
* @var string |
92 |
*/ |
|
5 | 93 |
public $section = ''; |
0 | 94 |
|
95 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
96 |
* Label for the control. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
97 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
98 |
* @since 3.4.0 |
0 | 99 |
* @var string |
100 |
*/ |
|
5 | 101 |
public $label = ''; |
102 |
||
103 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
104 |
* Description for the control. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
105 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
106 |
* @since 4.0.0 |
5 | 107 |
* @var string |
108 |
*/ |
|
109 |
public $description = ''; |
|
0 | 110 |
|
111 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
112 |
* List of choices for 'radio' or 'select' type controls, where values are the keys, and labels are the values. |
0 | 113 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
114 |
* @since 3.4.0 |
0 | 115 |
* @var array |
116 |
*/ |
|
5 | 117 |
public $choices = array(); |
0 | 118 |
|
119 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
120 |
* List of custom input attributes for control output, where attribute names are the keys and values are the values. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
121 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
122 |
* Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
123 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
124 |
* @since 4.0.0 |
0 | 125 |
* @var array |
126 |
*/ |
|
5 | 127 |
public $input_attrs = array(); |
128 |
||
129 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
130 |
* Show UI for adding new content, currently only used for the dropdown-pages control. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
131 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
132 |
* @since 4.7.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
133 |
* @var bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
134 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
135 |
public $allow_addition = false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
136 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
137 |
/** |
5 | 138 |
* @deprecated It is better to just call the json() method |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
139 |
* @since 3.4.0 |
5 | 140 |
* @var array |
141 |
*/ |
|
0 | 142 |
public $json = array(); |
143 |
||
144 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
145 |
* Control's Type. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
146 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
147 |
* @since 3.4.0 |
0 | 148 |
* @var string |
149 |
*/ |
|
150 |
public $type = 'text'; |
|
151 |
||
5 | 152 |
/** |
153 |
* Callback. |
|
154 |
* |
|
155 |
* @since 4.0.0 |
|
156 |
* |
|
157 |
* @see WP_Customize_Control::active() |
|
158 |
* |
|
159 |
* @var callable Callback is called with one argument, the instance of |
|
160 |
* WP_Customize_Control, and returns bool to indicate whether |
|
161 |
* the control is active (such as it relates to the URL |
|
162 |
* currently being previewed). |
|
163 |
*/ |
|
164 |
public $active_callback = ''; |
|
0 | 165 |
|
166 |
/** |
|
167 |
* Constructor. |
|
168 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
169 |
* Supplied `$args` override class property defaults. |
5 | 170 |
* |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
171 |
* If `$args['settings']` is not defined, use the `$id` as the setting ID. |
0 | 172 |
* |
173 |
* @since 3.4.0 |
|
174 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
175 |
* @param WP_Customize_Manager $manager Customizer bootstrap instance. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
176 |
* @param string $id Control ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
177 |
* @param array $args { |
16 | 178 |
* Optional. Array of properties for the new Control object. Default empty array. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
179 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
* @type int $instance_number Order in which this instance was created in relation |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
* to other instances. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
* @type WP_Customize_Manager $manager Customizer bootstrap instance. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
183 |
* @type string $id Control ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
184 |
* @type array $settings All settings tied to the control. If undefined, `$id` will |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
185 |
* be used. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
186 |
* @type string $setting The primary setting for the control (if there is one). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
187 |
* Default 'default'. |
16 | 188 |
* @type string $capability Capability required to use this control. Normally this is empty |
189 |
* and the capability is derived from `$settings`. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
190 |
* @type int $priority Order priority to load the control. Default 10. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
* @type string $section Section the control belongs to. Default empty. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
* @type string $label Label for the control. Default empty. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
193 |
* @type string $description Description for the control. Default empty. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
194 |
* @type array $choices List of choices for 'radio' or 'select' type controls, where |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
195 |
* values are the keys, and labels are the values. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
196 |
* Default empty array. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
197 |
* @type array $input_attrs List of custom input attributes for control output, where |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
198 |
* attribute names are the keys and values are the values. Not |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
199 |
* used for 'checkbox', 'radio', 'select', 'textarea', or |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
200 |
* 'dropdown-pages' control types. Default empty array. |
16 | 201 |
* @type bool $allow_addition Show UI for adding new content, currently only used for the |
202 |
* dropdown-pages control. Default false. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
203 |
* @type array $json Deprecated. Use WP_Customize_Control::json() instead. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
204 |
* @type string $type Control type. Core controls include 'text', 'checkbox', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
205 |
* 'textarea', 'radio', 'select', and 'dropdown-pages'. Additional |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
206 |
* input types such as 'email', 'url', 'number', 'hidden', and |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
207 |
* 'date' are supported implicitly. Default 'text'. |
16 | 208 |
* @type callable $active_callback Active callback. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
209 |
* } |
0 | 210 |
*/ |
5 | 211 |
public function __construct( $manager, $id, $args = array() ) { |
0 | 212 |
$keys = array_keys( get_object_vars( $this ) ); |
213 |
foreach ( $keys as $key ) { |
|
5 | 214 |
if ( isset( $args[ $key ] ) ) { |
0 | 215 |
$this->$key = $args[ $key ]; |
5 | 216 |
} |
0 | 217 |
} |
218 |
||
219 |
$this->manager = $manager; |
|
9 | 220 |
$this->id = $id; |
5 | 221 |
if ( empty( $this->active_callback ) ) { |
222 |
$this->active_callback = array( $this, 'active_callback' ); |
|
223 |
} |
|
224 |
self::$instance_count += 1; |
|
225 |
$this->instance_number = self::$instance_count; |
|
0 | 226 |
|
227 |
// Process settings. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
228 |
if ( ! isset( $this->settings ) ) { |
0 | 229 |
$this->settings = $id; |
5 | 230 |
} |
0 | 231 |
|
232 |
$settings = array(); |
|
233 |
if ( is_array( $this->settings ) ) { |
|
234 |
foreach ( $this->settings as $key => $setting ) { |
|
235 |
$settings[ $key ] = $this->manager->get_setting( $setting ); |
|
236 |
} |
|
9 | 237 |
} elseif ( is_string( $this->settings ) ) { |
238 |
$this->setting = $this->manager->get_setting( $this->settings ); |
|
0 | 239 |
$settings['default'] = $this->setting; |
240 |
} |
|
241 |
$this->settings = $settings; |
|
242 |
} |
|
243 |
||
244 |
/** |
|
245 |
* Enqueue control related scripts/styles. |
|
246 |
* |
|
247 |
* @since 3.4.0 |
|
248 |
*/ |
|
249 |
public function enqueue() {} |
|
250 |
||
5 | 251 |
/** |
252 |
* Check whether control is active to current Customizer preview. |
|
253 |
* |
|
254 |
* @since 4.0.0 |
|
255 |
* |
|
256 |
* @return bool Whether the control is active to the current preview. |
|
257 |
*/ |
|
258 |
final public function active() { |
|
259 |
$control = $this; |
|
9 | 260 |
$active = call_user_func( $this->active_callback, $this ); |
5 | 261 |
|
262 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
263 |
* Filters response of WP_Customize_Control::active(). |
5 | 264 |
* |
265 |
* @since 4.0.0 |
|
266 |
* |
|
267 |
* @param bool $active Whether the Customizer control is active. |
|
268 |
* @param WP_Customize_Control $control WP_Customize_Control instance. |
|
269 |
*/ |
|
270 |
$active = apply_filters( 'customize_control_active', $active, $control ); |
|
271 |
||
272 |
return $active; |
|
273 |
} |
|
274 |
||
275 |
/** |
|
276 |
* Default callback used when invoking WP_Customize_Control::active(). |
|
277 |
* |
|
278 |
* Subclasses can override this with their specific logic, or they may |
|
279 |
* provide an 'active_callback' argument to the constructor. |
|
280 |
* |
|
281 |
* @since 4.0.0 |
|
282 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
283 |
* @return true Always true. |
5 | 284 |
*/ |
285 |
public function active_callback() { |
|
286 |
return true; |
|
287 |
} |
|
0 | 288 |
|
289 |
/** |
|
290 |
* Fetch a setting's value. |
|
291 |
* Grabs the main setting by default. |
|
292 |
* |
|
293 |
* @since 3.4.0 |
|
294 |
* |
|
295 |
* @param string $setting_key |
|
296 |
* @return mixed The requested setting's value, if the setting exists. |
|
297 |
*/ |
|
5 | 298 |
final public function value( $setting_key = 'default' ) { |
299 |
if ( isset( $this->settings[ $setting_key ] ) ) { |
|
0 | 300 |
return $this->settings[ $setting_key ]->value(); |
5 | 301 |
} |
0 | 302 |
} |
303 |
||
304 |
/** |
|
305 |
* Refresh the parameters passed to the JavaScript via JSON. |
|
306 |
* |
|
307 |
* @since 3.4.0 |
|
308 |
*/ |
|
309 |
public function to_json() { |
|
310 |
$this->json['settings'] = array(); |
|
311 |
foreach ( $this->settings as $key => $setting ) { |
|
312 |
$this->json['settings'][ $key ] = $setting->id; |
|
313 |
} |
|
314 |
||
9 | 315 |
$this->json['type'] = $this->type; |
316 |
$this->json['priority'] = $this->priority; |
|
317 |
$this->json['active'] = $this->active(); |
|
318 |
$this->json['section'] = $this->section; |
|
319 |
$this->json['content'] = $this->get_content(); |
|
320 |
$this->json['label'] = $this->label; |
|
321 |
$this->json['description'] = $this->description; |
|
5 | 322 |
$this->json['instanceNumber'] = $this->instance_number; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
323 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
324 |
if ( 'dropdown-pages' === $this->type ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
325 |
$this->json['allow_addition'] = $this->allow_addition; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
326 |
} |
5 | 327 |
} |
328 |
||
329 |
/** |
|
330 |
* Get the data to export to the client via JSON. |
|
331 |
* |
|
332 |
* @since 4.1.0 |
|
333 |
* |
|
334 |
* @return array Array of parameters passed to the JavaScript. |
|
335 |
*/ |
|
336 |
public function json() { |
|
337 |
$this->to_json(); |
|
338 |
return $this->json; |
|
0 | 339 |
} |
340 |
||
341 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
342 |
* Checks if the user can use this control. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
343 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
344 |
* Returns false if the user cannot manipulate one of the associated settings, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
345 |
* or if one of the associated settings does not exist. Also returns false if |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
346 |
* the associated section does not exist or if its capability check returns |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
347 |
* false. |
0 | 348 |
* |
349 |
* @since 3.4.0 |
|
350 |
* |
|
351 |
* @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true. |
|
352 |
*/ |
|
5 | 353 |
final public function check_capabilities() { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
354 |
if ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
355 |
return false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
356 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
357 |
|
0 | 358 |
foreach ( $this->settings as $setting ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
359 |
if ( ! $setting || ! $setting->check_capabilities() ) { |
0 | 360 |
return false; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
361 |
} |
0 | 362 |
} |
363 |
||
364 |
$section = $this->manager->get_section( $this->section ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
365 |
if ( isset( $section ) && ! $section->check_capabilities() ) { |
0 | 366 |
return false; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
367 |
} |
0 | 368 |
|
369 |
return true; |
|
370 |
} |
|
371 |
||
372 |
/** |
|
5 | 373 |
* Get the control's content for insertion into the Customizer pane. |
374 |
* |
|
375 |
* @since 4.1.0 |
|
376 |
* |
|
377 |
* @return string Contents of the control. |
|
378 |
*/ |
|
379 |
final public function get_content() { |
|
380 |
ob_start(); |
|
381 |
$this->maybe_render(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
382 |
return trim( ob_get_clean() ); |
5 | 383 |
} |
384 |
||
385 |
/** |
|
0 | 386 |
* Check capabilities and render the control. |
387 |
* |
|
388 |
* @since 3.4.0 |
|
389 |
* @uses WP_Customize_Control::render() |
|
390 |
*/ |
|
5 | 391 |
final public function maybe_render() { |
9 | 392 |
if ( ! $this->check_capabilities() ) { |
0 | 393 |
return; |
9 | 394 |
} |
0 | 395 |
|
5 | 396 |
/** |
397 |
* Fires just before the current Customizer control is rendered. |
|
398 |
* |
|
399 |
* @since 3.4.0 |
|
400 |
* |
|
19 | 401 |
* @param WP_Customize_Control $control WP_Customize_Control instance. |
5 | 402 |
*/ |
0 | 403 |
do_action( 'customize_render_control', $this ); |
5 | 404 |
|
405 |
/** |
|
406 |
* Fires just before a specific Customizer control is rendered. |
|
407 |
* |
|
408 |
* The dynamic portion of the hook name, `$this->id`, refers to |
|
409 |
* the control ID. |
|
410 |
* |
|
411 |
* @since 3.4.0 |
|
412 |
* |
|
19 | 413 |
* @param WP_Customize_Control $control WP_Customize_Control instance. |
5 | 414 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
415 |
do_action( "customize_render_control_{$this->id}", $this ); |
0 | 416 |
|
417 |
$this->render(); |
|
418 |
} |
|
419 |
||
420 |
/** |
|
5 | 421 |
* Renders the control wrapper and calls $this->render_content() for the internals. |
0 | 422 |
* |
423 |
* @since 3.4.0 |
|
424 |
*/ |
|
425 |
protected function render() { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
426 |
$id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id ); |
0 | 427 |
$class = 'customize-control customize-control-' . $this->type; |
428 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
429 |
printf( '<li id="%s" class="%s">', esc_attr( $id ), esc_attr( $class ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
430 |
$this->render_content(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
431 |
echo '</li>'; |
0 | 432 |
} |
433 |
||
434 |
/** |
|
5 | 435 |
* Get the data link attribute for a setting. |
0 | 436 |
* |
437 |
* @since 3.4.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
438 |
* @since 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key. |
0 | 439 |
* |
440 |
* @param string $setting_key |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
441 |
* @return string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
442 |
* and a `data-customize-setting-key-link` attribute if the setting is not yet registered. |
0 | 443 |
*/ |
444 |
public function get_link( $setting_key = 'default' ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
445 |
if ( isset( $this->settings[ $setting_key ] ) && $this->settings[ $setting_key ] instanceof WP_Customize_Setting ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
446 |
return 'data-customize-setting-link="' . esc_attr( $this->settings[ $setting_key ]->id ) . '"'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
447 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
448 |
return 'data-customize-setting-key-link="' . esc_attr( $setting_key ) . '"'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
449 |
} |
0 | 450 |
} |
451 |
||
452 |
/** |
|
5 | 453 |
* Render the data link attribute for the control's input element. |
0 | 454 |
* |
455 |
* @since 3.4.0 |
|
456 |
* @uses WP_Customize_Control::get_link() |
|
457 |
* |
|
458 |
* @param string $setting_key |
|
459 |
*/ |
|
460 |
public function link( $setting_key = 'default' ) { |
|
461 |
echo $this->get_link( $setting_key ); |
|
462 |
} |
|
463 |
||
464 |
/** |
|
5 | 465 |
* Render the custom attributes for the control's input element. |
466 |
* |
|
467 |
* @since 4.0.0 |
|
468 |
*/ |
|
469 |
public function input_attrs() { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
470 |
foreach ( $this->input_attrs as $attr => $value ) { |
5 | 471 |
echo $attr . '="' . esc_attr( $value ) . '" '; |
472 |
} |
|
473 |
} |
|
474 |
||
475 |
/** |
|
0 | 476 |
* Render the control's content. |
477 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
478 |
* Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`. |
5 | 479 |
* |
480 |
* Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. |
|
481 |
* Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. |
|
482 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
483 |
* Control content can alternately be rendered in JS. See WP_Customize_Control::print_template(). |
0 | 484 |
* |
485 |
* @since 3.4.0 |
|
486 |
*/ |
|
487 |
protected function render_content() { |
|
9 | 488 |
$input_id = '_customize-input-' . $this->id; |
489 |
$description_id = '_customize-description-' . $this->id; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
490 |
$describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
switch ( $this->type ) { |
0 | 492 |
case 'checkbox': |
493 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
494 |
<span class="customize-inside-control-row"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
495 |
<input |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
496 |
id="<?php echo esc_attr( $input_id ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
497 |
<?php echo $describedby_attr; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
498 |
type="checkbox" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
499 |
value="<?php echo esc_attr( $this->value() ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
500 |
<?php $this->link(); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
501 |
<?php checked( $this->value() ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
502 |
/> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
503 |
<label for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $this->label ); ?></label> |
5 | 504 |
<?php if ( ! empty( $this->description ) ) : ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
505 |
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> |
5 | 506 |
<?php endif; ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
507 |
</span> |
0 | 508 |
<?php |
509 |
break; |
|
510 |
case 'radio': |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
511 |
if ( empty( $this->choices ) ) { |
0 | 512 |
return; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
513 |
} |
0 | 514 |
|
515 |
$name = '_customize-radio-' . $this->id; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
516 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
517 |
<?php if ( ! empty( $this->label ) ) : ?> |
5 | 518 |
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
519 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
520 |
<?php if ( ! empty( $this->description ) ) : ?> |
9 | 521 |
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
522 |
<?php endif; ?> |
5 | 523 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
524 |
<?php foreach ( $this->choices as $value => $label ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
525 |
<span class="customize-inside-control-row"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
526 |
<input |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
527 |
id="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
528 |
type="radio" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
529 |
<?php echo $describedby_attr; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
530 |
value="<?php echo esc_attr( $value ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
531 |
name="<?php echo esc_attr( $name ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
532 |
<?php $this->link(); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
533 |
<?php checked( $this->value(), $value ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
534 |
/> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
535 |
<label for="<?php echo esc_attr( $input_id . '-radio-' . $value ); ?>"><?php echo esc_html( $label ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
536 |
</span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
537 |
<?php endforeach; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
538 |
<?php |
0 | 539 |
break; |
540 |
case 'select': |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
541 |
if ( empty( $this->choices ) ) { |
0 | 542 |
return; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
543 |
} |
0 | 544 |
|
545 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
546 |
<?php if ( ! empty( $this->label ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
547 |
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
548 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
549 |
<?php if ( ! empty( $this->description ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
550 |
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
551 |
<?php endif; ?> |
5 | 552 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
553 |
<select id="<?php echo esc_attr( $input_id ); ?>" <?php echo $describedby_attr; ?> <?php $this->link(); ?>> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
554 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
555 |
foreach ( $this->choices as $value => $label ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
556 |
echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . esc_html( $label ) . '</option>'; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
557 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
558 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
559 |
</select> |
0 | 560 |
<?php |
561 |
break; |
|
5 | 562 |
case 'textarea': |
563 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
564 |
<?php if ( ! empty( $this->label ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
565 |
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
566 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
567 |
<?php if ( ! empty( $this->description ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
568 |
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
569 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
570 |
<textarea |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
571 |
id="<?php echo esc_attr( $input_id ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
572 |
rows="5" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
573 |
<?php echo $describedby_attr; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
574 |
<?php $this->input_attrs(); ?> |
9 | 575 |
<?php $this->link(); ?> |
576 |
><?php echo esc_textarea( $this->value() ); ?></textarea> |
|
5 | 577 |
<?php |
578 |
break; |
|
0 | 579 |
case 'dropdown-pages': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
580 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
581 |
<?php if ( ! empty( $this->label ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
582 |
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
583 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
584 |
<?php if ( ! empty( $this->description ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
585 |
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
586 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
587 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
588 |
<?php |
9 | 589 |
$dropdown_name = '_customize-dropdown-pages-' . $this->id; |
590 |
$show_option_none = __( '— Select —' ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
591 |
$option_none_value = '0'; |
9 | 592 |
$dropdown = wp_dropdown_pages( |
0 | 593 |
array( |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
594 |
'name' => $dropdown_name, |
0 | 595 |
'echo' => 0, |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
596 |
'show_option_none' => $show_option_none, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
597 |
'option_none_value' => $option_none_value, |
0 | 598 |
'selected' => $this->value(), |
599 |
) |
|
600 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
601 |
if ( empty( $dropdown ) ) { |
9 | 602 |
$dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
603 |
$dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
604 |
$dropdown .= '</select>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
605 |
} |
0 | 606 |
|
607 |
// Hackily add in the data link parameter. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
608 |
$dropdown = str_replace( '<select', '<select ' . $this->get_link() . ' id="' . esc_attr( $input_id ) . '" ' . $describedby_attr, $dropdown ); |
0 | 609 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
610 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
611 |
* Even more hacikly add auto-draft page stubs. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
612 |
* @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
613 |
* See <https://github.com/xwp/wp-customize-posts/pull/250>. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
614 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
615 |
$nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
616 |
if ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
617 |
$auto_draft_page_options = ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
618 |
foreach ( $nav_menus_created_posts_setting->value() as $auto_draft_page_id ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
619 |
$post = get_post( $auto_draft_page_id ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
620 |
if ( $post && 'page' === $post->post_type ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
621 |
$auto_draft_page_options .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $post->ID ), esc_html( $post->post_title ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
622 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
623 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
624 |
if ( $auto_draft_page_options ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
625 |
$dropdown = str_replace( '</select>', $auto_draft_page_options . '</select>', $dropdown ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
626 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
627 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
628 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
629 |
echo $dropdown; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
630 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
631 |
<?php if ( $this->allow_addition && current_user_can( 'publish_pages' ) && current_user_can( 'edit_theme_options' ) ) : // Currently tied to menus functionality. ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
632 |
<button type="button" class="button-link add-new-toggle"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
633 |
<?php |
16 | 634 |
/* translators: %s: Add New Page label. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
635 |
printf( __( '+ %s' ), get_post_type_object( 'page' )->labels->add_new_item ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
636 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
637 |
</button> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
638 |
<div class="new-content-item-wrapper"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
639 |
<label for="create-input-<?php echo esc_attr( $this->id ); ?>"><?php _e( 'New page title' ); ?></label> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
640 |
<div class="new-content-item"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
641 |
<input type="text" id="create-input-<?php echo esc_attr( $this->id ); ?>" class="create-item-input" > |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
642 |
<button type="button" class="button add-content"><?php _e( 'Add' ); ?></button> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
643 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
644 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
645 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
646 |
<?php |
0 | 647 |
break; |
5 | 648 |
default: |
649 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
650 |
<?php if ( ! empty( $this->label ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
651 |
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
652 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
653 |
<?php if ( ! empty( $this->description ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
654 |
<span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
655 |
<?php endif; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
656 |
<input |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
657 |
id="<?php echo esc_attr( $input_id ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
658 |
type="<?php echo esc_attr( $this->type ); ?>" |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
659 |
<?php echo $describedby_attr; ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
660 |
<?php $this->input_attrs(); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
661 |
<?php if ( ! isset( $this->input_attrs['value'] ) ) : ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
662 |
value="<?php echo esc_attr( $this->value() ); ?>" |
5 | 663 |
<?php endif; ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
664 |
<?php $this->link(); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
665 |
/> |
5 | 666 |
<?php |
667 |
break; |
|
0 | 668 |
} |
669 |
} |
|
5 | 670 |
|
671 |
/** |
|
672 |
* Render the control's JS template. |
|
673 |
* |
|
674 |
* This function is only run for control types that have been registered with |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
675 |
* WP_Customize_Manager::register_control_type(). |
5 | 676 |
* |
677 |
* In the future, this will also print the template for the control's container |
|
678 |
* element and be override-able. |
|
679 |
* |
|
680 |
* @since 4.1.0 |
|
681 |
*/ |
|
682 |
final public function print_template() { |
|
683 |
?> |
|
19 | 684 |
<script type="text/html" id="tmpl-customize-control-<?php echo esc_attr( $this->type ); ?>-content"> |
5 | 685 |
<?php $this->content_template(); ?> |
686 |
</script> |
|
687 |
<?php |
|
688 |
} |
|
689 |
||
690 |
/** |
|
691 |
* An Underscore (JS) template for this control's content (but not its container). |
|
692 |
* |
|
693 |
* Class variables for this control class are available in the `data` JS object; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
694 |
* export custom variables by overriding WP_Customize_Control::to_json(). |
5 | 695 |
* |
696 |
* @see WP_Customize_Control::print_template() |
|
697 |
* |
|
698 |
* @since 4.1.0 |
|
699 |
*/ |
|
700 |
protected function content_template() {} |
|
0 | 701 |
} |
702 |
||
703 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
704 |
* WP_Customize_Color_Control class. |
0 | 705 |
*/ |
16 | 706 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-color-control.php'; |
0 | 707 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
708 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
709 |
* WP_Customize_Media_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
710 |
*/ |
16 | 711 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-media-control.php'; |
0 | 712 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
713 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
714 |
* WP_Customize_Upload_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
715 |
*/ |
16 | 716 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-upload-control.php'; |
0 | 717 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
718 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
719 |
* WP_Customize_Image_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
720 |
*/ |
16 | 721 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-image-control.php'; |
0 | 722 |
|
723 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
724 |
* WP_Customize_Background_Image_Control class. |
0 | 725 |
*/ |
16 | 726 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-control.php'; |
5 | 727 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
728 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
729 |
* WP_Customize_Background_Position_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
730 |
*/ |
16 | 731 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-position-control.php'; |
0 | 732 |
|
5 | 733 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
734 |
* WP_Customize_Cropped_Image_Control class. |
5 | 735 |
*/ |
16 | 736 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-cropped-image-control.php'; |
5 | 737 |
|
738 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
739 |
* WP_Customize_Site_Icon_Control class. |
5 | 740 |
*/ |
16 | 741 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-site-icon-control.php'; |
0 | 742 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
743 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
744 |
* WP_Customize_Header_Image_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
745 |
*/ |
16 | 746 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-control.php'; |
0 | 747 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
748 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
749 |
* WP_Customize_Theme_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
750 |
*/ |
16 | 751 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-theme-control.php'; |
0 | 752 |
|
753 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
754 |
* WP_Widget_Area_Customize_Control class. |
0 | 755 |
*/ |
16 | 756 |
require_once ABSPATH . WPINC . '/customize/class-wp-widget-area-customize-control.php'; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
757 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
758 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
759 |
* WP_Widget_Form_Customize_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
760 |
*/ |
16 | 761 |
require_once ABSPATH . WPINC . '/customize/class-wp-widget-form-customize-control.php'; |
0 | 762 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
763 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
764 |
* WP_Customize_Nav_Menu_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
765 |
*/ |
16 | 766 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-control.php'; |
0 | 767 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
768 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
769 |
* WP_Customize_Nav_Menu_Item_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
770 |
*/ |
16 | 771 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-control.php'; |
0 | 772 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
773 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
774 |
* WP_Customize_Nav_Menu_Location_Control class. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
775 |
*/ |
16 | 776 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-location-control.php'; |
0 | 777 |
|
778 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
779 |
* WP_Customize_Nav_Menu_Name_Control class. |
0 | 780 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
781 |
* As this file is deprecated, it will trigger a deprecation notice if instantiated. In a subsequent |
16 | 782 |
* release, the require_once here will be removed and _deprecated_file() will be called if file is |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
783 |
* required at all. |
5 | 784 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
785 |
* @deprecated 4.9.0 This file is no longer used due to new menu creation UX. |
0 | 786 |
*/ |
16 | 787 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-name-control.php'; |
0 | 788 |
|
5 | 789 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
790 |
* WP_Customize_Nav_Menu_Locations_Control class. |
5 | 791 |
*/ |
16 | 792 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-locations-control.php'; |
0 | 793 |
|
5 | 794 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
795 |
* WP_Customize_Nav_Menu_Auto_Add_Control class. |
5 | 796 |
*/ |
16 | 797 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-auto-add-control.php'; |
5 | 798 |
|
799 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
800 |
* WP_Customize_Date_Time_Control class. |
5 | 801 |
*/ |
16 | 802 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-date-time-control.php'; |
18 | 803 |
|
804 |
/** |
|
805 |
* WP_Sidebar_Block_Editor_Control class. |
|
806 |
*/ |
|
807 |
require_once ABSPATH . WPINC . '/customize/class-wp-sidebar-block-editor-control.php'; |