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