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