author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
5 | 1 |
<?php |
2 |
/** |
|
3 |
* WordPress Customize Panel classes |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Customize |
|
7 |
* @since 4.0.0 |
|
8 |
*/ |
|
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 Panel class. |
|
17 |
* |
|
18 |
* A UI container for sections, managed by the WP_Customize_Manager. |
|
19 |
* |
|
20 |
* @since 4.0.0 |
|
21 |
* |
|
22 |
* @see WP_Customize_Manager |
|
23 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
24 |
#[AllowDynamicProperties] |
5 | 25 |
class WP_Customize_Panel { |
26 |
||
27 |
/** |
|
28 |
* Incremented with each new class instantiation, then stored in $instance_number. |
|
29 |
* |
|
30 |
* Used when sorting two instances whose priorities are equal. |
|
31 |
* |
|
32 |
* @since 4.1.0 |
|
33 |
* @var int |
|
34 |
*/ |
|
35 |
protected static $instance_count = 0; |
|
36 |
||
37 |
/** |
|
38 |
* Order in which this instance was created in relation to other instances. |
|
39 |
* |
|
40 |
* @since 4.1.0 |
|
41 |
* @var int |
|
42 |
*/ |
|
43 |
public $instance_number; |
|
44 |
||
45 |
/** |
|
46 |
* WP_Customize_Manager instance. |
|
47 |
* |
|
48 |
* @since 4.0.0 |
|
49 |
* @var WP_Customize_Manager |
|
50 |
*/ |
|
51 |
public $manager; |
|
52 |
||
53 |
/** |
|
54 |
* Unique identifier. |
|
55 |
* |
|
56 |
* @since 4.0.0 |
|
57 |
* @var string |
|
58 |
*/ |
|
59 |
public $id; |
|
60 |
||
61 |
/** |
|
62 |
* Priority of the panel, defining the display order of panels and sections. |
|
63 |
* |
|
64 |
* @since 4.0.0 |
|
19 | 65 |
* @var int |
5 | 66 |
*/ |
67 |
public $priority = 160; |
|
68 |
||
69 |
/** |
|
70 |
* Capability required for the panel. |
|
71 |
* |
|
72 |
* @since 4.0.0 |
|
73 |
* @var string |
|
74 |
*/ |
|
75 |
public $capability = 'edit_theme_options'; |
|
76 |
||
77 |
/** |
|
16 | 78 |
* Theme features required to support the panel. |
5 | 79 |
* |
80 |
* @since 4.0.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
81 |
* @var mixed[] |
5 | 82 |
*/ |
83 |
public $theme_supports = ''; |
|
84 |
||
85 |
/** |
|
86 |
* Title of the panel to show in UI. |
|
87 |
* |
|
88 |
* @since 4.0.0 |
|
89 |
* @var string |
|
90 |
*/ |
|
91 |
public $title = ''; |
|
92 |
||
93 |
/** |
|
94 |
* Description to show in the UI. |
|
95 |
* |
|
96 |
* @since 4.0.0 |
|
97 |
* @var string |
|
98 |
*/ |
|
99 |
public $description = ''; |
|
100 |
||
101 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
102 |
* Auto-expand a section in a panel when the panel is expanded when the panel only has the one section. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
103 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
104 |
* @since 4.7.4 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
105 |
* @var bool |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
106 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
107 |
public $auto_expand_sole_section = false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
108 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
109 |
/** |
5 | 110 |
* Customizer sections for this panel. |
111 |
* |
|
112 |
* @since 4.0.0 |
|
113 |
* @var array |
|
114 |
*/ |
|
115 |
public $sections; |
|
116 |
||
117 |
/** |
|
118 |
* Type of this panel. |
|
119 |
* |
|
120 |
* @since 4.1.0 |
|
121 |
* @var string |
|
122 |
*/ |
|
123 |
public $type = 'default'; |
|
124 |
||
125 |
/** |
|
126 |
* Active callback. |
|
127 |
* |
|
128 |
* @since 4.1.0 |
|
129 |
* |
|
130 |
* @see WP_Customize_Section::active() |
|
131 |
* |
|
132 |
* @var callable Callback is called with one argument, the instance of |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
133 |
* WP_Customize_Section, and returns bool to indicate whether |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
134 |
* the section is active (such as it relates to the URL currently |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
135 |
* being previewed). |
5 | 136 |
*/ |
137 |
public $active_callback = ''; |
|
138 |
||
139 |
/** |
|
140 |
* Constructor. |
|
141 |
* |
|
142 |
* Any supplied $args override class property defaults. |
|
143 |
* |
|
144 |
* @since 4.0.0 |
|
145 |
* |
|
146 |
* @param WP_Customize_Manager $manager Customizer bootstrap instance. |
|
16 | 147 |
* @param string $id A specific ID for the panel. |
148 |
* @param array $args { |
|
149 |
* Optional. Array of properties for the new Panel object. Default empty array. |
|
150 |
* |
|
151 |
* @type int $priority Priority of the panel, defining the display order |
|
152 |
* of panels and sections. Default 160. |
|
153 |
* @type string $capability Capability required for the panel. |
|
154 |
* Default `edit_theme_options`. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
155 |
* @type mixed[] $theme_supports Theme features required to support the panel. |
16 | 156 |
* @type string $title Title of the panel to show in UI. |
157 |
* @type string $description Description to show in the UI. |
|
158 |
* @type string $type Type of the panel. |
|
159 |
* @type callable $active_callback Active callback. |
|
160 |
* } |
|
5 | 161 |
*/ |
162 |
public function __construct( $manager, $id, $args = array() ) { |
|
163 |
$keys = array_keys( get_object_vars( $this ) ); |
|
164 |
foreach ( $keys as $key ) { |
|
165 |
if ( isset( $args[ $key ] ) ) { |
|
166 |
$this->$key = $args[ $key ]; |
|
167 |
} |
|
168 |
} |
|
169 |
||
170 |
$this->manager = $manager; |
|
9 | 171 |
$this->id = $id; |
5 | 172 |
if ( empty( $this->active_callback ) ) { |
173 |
$this->active_callback = array( $this, 'active_callback' ); |
|
174 |
} |
|
175 |
self::$instance_count += 1; |
|
176 |
$this->instance_number = self::$instance_count; |
|
177 |
||
178 |
$this->sections = array(); // Users cannot customize the $sections array. |
|
179 |
} |
|
180 |
||
181 |
/** |
|
182 |
* Check whether panel is active to current Customizer preview. |
|
183 |
* |
|
184 |
* @since 4.1.0 |
|
185 |
* |
|
186 |
* @return bool Whether the panel is active to the current preview. |
|
187 |
*/ |
|
188 |
final public function active() { |
|
9 | 189 |
$panel = $this; |
5 | 190 |
$active = call_user_func( $this->active_callback, $this ); |
191 |
||
192 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
193 |
* Filters response of WP_Customize_Panel::active(). |
5 | 194 |
* |
195 |
* @since 4.1.0 |
|
196 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
197 |
* @param bool $active Whether the Customizer panel is active. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
198 |
* @param WP_Customize_Panel $panel WP_Customize_Panel instance. |
5 | 199 |
*/ |
200 |
$active = apply_filters( 'customize_panel_active', $active, $panel ); |
|
201 |
||
202 |
return $active; |
|
203 |
} |
|
204 |
||
205 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
206 |
* Default callback used when invoking WP_Customize_Panel::active(). |
5 | 207 |
* |
208 |
* Subclasses can override this with their specific logic, or they may |
|
209 |
* provide an 'active_callback' argument to the constructor. |
|
210 |
* |
|
211 |
* @since 4.1.0 |
|
212 |
* |
|
213 |
* @return bool Always true. |
|
214 |
*/ |
|
215 |
public function active_callback() { |
|
216 |
return true; |
|
217 |
} |
|
218 |
||
219 |
/** |
|
220 |
* Gather the parameters passed to client JavaScript via JSON. |
|
221 |
* |
|
222 |
* @since 4.1.0 |
|
223 |
* |
|
224 |
* @return array The array to be exported to the client as JSON. |
|
225 |
*/ |
|
226 |
public function json() { |
|
9 | 227 |
$array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type' ) ); |
228 |
$array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); |
|
229 |
$array['content'] = $this->get_content(); |
|
230 |
$array['active'] = $this->active(); |
|
231 |
$array['instanceNumber'] = $this->instance_number; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
232 |
$array['autoExpandSoleSection'] = $this->auto_expand_sole_section; |
5 | 233 |
return $array; |
234 |
} |
|
235 |
||
236 |
/** |
|
237 |
* Checks required user capabilities and whether the theme has the |
|
238 |
* feature support required by the panel. |
|
239 |
* |
|
240 |
* @since 4.0.0 |
|
19 | 241 |
* @since 5.9.0 Method was marked non-final. |
5 | 242 |
* |
243 |
* @return bool False if theme doesn't support the panel or the user doesn't have the capability. |
|
244 |
*/ |
|
19 | 245 |
public function check_capabilities() { |
16 | 246 |
if ( $this->capability && ! current_user_can( $this->capability ) ) { |
5 | 247 |
return false; |
248 |
} |
|
249 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
250 |
if ( $this->theme_supports && ! current_theme_supports( ...(array) $this->theme_supports ) ) { |
5 | 251 |
return false; |
252 |
} |
|
253 |
||
254 |
return true; |
|
255 |
} |
|
256 |
||
257 |
/** |
|
258 |
* Get the panel's content template for insertion into the Customizer pane. |
|
259 |
* |
|
260 |
* @since 4.1.0 |
|
261 |
* |
|
262 |
* @return string Content for the panel. |
|
263 |
*/ |
|
264 |
final public function get_content() { |
|
265 |
ob_start(); |
|
266 |
$this->maybe_render(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
267 |
return trim( ob_get_clean() ); |
5 | 268 |
} |
269 |
||
270 |
/** |
|
271 |
* Check capabilities and render the panel. |
|
272 |
* |
|
273 |
* @since 4.0.0 |
|
274 |
*/ |
|
275 |
final public function maybe_render() { |
|
276 |
if ( ! $this->check_capabilities() ) { |
|
277 |
return; |
|
278 |
} |
|
279 |
||
280 |
/** |
|
281 |
* Fires before rendering a Customizer panel. |
|
282 |
* |
|
283 |
* @since 4.0.0 |
|
284 |
* |
|
19 | 285 |
* @param WP_Customize_Panel $panel WP_Customize_Panel instance. |
5 | 286 |
*/ |
287 |
do_action( 'customize_render_panel', $this ); |
|
288 |
||
289 |
/** |
|
290 |
* Fires before rendering a specific Customizer panel. |
|
291 |
* |
|
292 |
* The dynamic portion of the hook name, `$this->id`, refers to |
|
293 |
* the ID of the specific Customizer panel to be rendered. |
|
294 |
* |
|
295 |
* @since 4.0.0 |
|
296 |
*/ |
|
297 |
do_action( "customize_render_panel_{$this->id}" ); |
|
298 |
||
299 |
$this->render(); |
|
300 |
} |
|
301 |
||
302 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
303 |
* Render the panel container, and then its contents (via `this->render_content()`) in a subclass. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
304 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
305 |
* Panel containers are now rendered in JS by default, see WP_Customize_Panel::print_template(). |
5 | 306 |
* |
307 |
* @since 4.0.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
308 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
309 |
protected function render() {} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
310 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
311 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
312 |
* Render the panel UI in a subclass. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
313 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
314 |
* Panel contents are now rendered in JS by default, see WP_Customize_Panel::print_template(). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
315 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
316 |
* @since 4.1.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
317 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
318 |
protected function render_content() {} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
319 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
320 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
321 |
* Render the panel's JS templates. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
322 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
323 |
* This function is only run for panel types that have been registered with |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
324 |
* WP_Customize_Manager::register_panel_type(). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
325 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
326 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
327 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
328 |
* @see WP_Customize_Manager::register_panel_type() |
5 | 329 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
330 |
public function print_template() { |
5 | 331 |
?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
332 |
<script type="text/html" id="tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>-content"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
333 |
<?php $this->content_template(); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
334 |
</script> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
335 |
<script type="text/html" id="tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
336 |
<?php $this->render_template(); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
337 |
</script> |
9 | 338 |
<?php |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
339 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
340 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
341 |
/** |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
342 |
* An Underscore (JS) template for rendering this panel's container. |
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 |
* Class variables for this panel class are available in the `data` JS object; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
345 |
* export custom variables by overriding WP_Customize_Panel::json(). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
346 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
347 |
* @see WP_Customize_Panel::print_template() |
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 |
* @since 4.3.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
350 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
351 |
protected function render_template() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
352 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
353 |
<li id="accordion-panel-{{ data.id }}" class="accordion-section control-section control-panel control-panel-{{ data.type }}"> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
354 |
<h3 class="accordion-section-title"> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
355 |
<button type="button" class="accordion-trigger" aria-expanded="false" aria-controls="{{ data.id }}-content"> |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
356 |
{{ data.title }} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
357 |
</button> |
5 | 358 |
</h3> |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
359 |
<ul class="accordion-sub-container control-panel-content" id="{{ data.id }}-content"></ul> |
5 | 360 |
</li> |
361 |
<?php |
|
362 |
} |
|
363 |
||
364 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
365 |
* An Underscore (JS) template for this panel's content (but not its container). |
5 | 366 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
367 |
* Class variables for this panel class are available in the `data` JS object; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
368 |
* export custom variables by overriding WP_Customize_Panel::json(). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
369 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
370 |
* @see WP_Customize_Panel::print_template() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
371 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
372 |
* @since 4.3.0 |
5 | 373 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
374 |
protected function content_template() { |
5 | 375 |
?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
376 |
<li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
377 |
<button class="customize-panel-back" tabindex="-1"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
378 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
379 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
380 |
_e( 'Back' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
381 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
382 |
</span></button> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
383 |
<div class="accordion-section-title"> |
9 | 384 |
<span class="preview-notice"> |
385 |
<?php |
|
16 | 386 |
/* translators: %s: The site/panel title in the Customizer. */ |
387 |
printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' ); |
|
9 | 388 |
?> |
389 |
</span> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
390 |
<# if ( data.description ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
391 |
<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
392 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
393 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
394 |
_e( 'Help' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
395 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
396 |
</span></button> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
397 |
<# } #> |
5 | 398 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
399 |
<# if ( data.description ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
400 |
<div class="description customize-panel-description"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
401 |
{{{ data.description }}} |
5 | 402 |
</div> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
403 |
<# } #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
404 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
405 |
<div class="customize-control-notifications-container"></div> |
5 | 406 |
</li> |
407 |
<?php |
|
408 |
} |
|
409 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
410 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
/** WP_Customize_Nav_Menus_Panel class */ |
16 | 412 |
require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php'; |