author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* WordPress media templates. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Media |
|
7 |
* @since 3.5.0 |
|
8 |
*/ |
|
9 |
||
10 |
/** |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
11 |
* Outputs the markup for an audio tag to be used in an Underscore template |
5 | 12 |
* when data.model is passed. |
13 |
* |
|
14 |
* @since 3.9.0 |
|
15 |
*/ |
|
16 |
function wp_underscore_audio_template() { |
|
17 |
$audio_types = wp_get_audio_extensions(); |
|
9 | 18 |
?> |
5 | 19 |
<audio style="visibility: hidden" |
20 |
controls |
|
21 |
class="wp-audio-shortcode" |
|
22 |
width="{{ _.isUndefined( data.model.width ) ? 400 : data.model.width }}" |
|
23 |
preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}" |
|
24 |
<# |
|
9 | 25 |
<?php |
26 |
foreach ( array( 'autoplay', 'loop' ) as $attr ) : |
|
27 |
?> |
|
28 |
if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) { |
|
29 |
#> <?php echo $attr; ?><# |
|
5 | 30 |
} |
19 | 31 |
<?php endforeach; ?>#> |
5 | 32 |
> |
33 |
<# if ( ! _.isEmpty( data.model.src ) ) { #> |
|
34 |
<source src="{{ data.model.src }}" type="{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}" /> |
|
35 |
<# } #> |
|
36 |
||
9 | 37 |
<?php |
38 |
foreach ( $audio_types as $type ) : |
|
39 |
?> |
|
40 |
<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) { #> |
|
41 |
<source src="{{ data.model.<?php echo $type; ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type; ?>' ] }}" /> |
|
5 | 42 |
<# } #> |
9 | 43 |
<?php |
44 |
endforeach; |
|
45 |
?> |
|
46 |
</audio> |
|
47 |
<?php |
|
5 | 48 |
} |
49 |
||
50 |
/** |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
51 |
* Outputs the markup for a video tag to be used in an Underscore template |
5 | 52 |
* when data.model is passed. |
53 |
* |
|
54 |
* @since 3.9.0 |
|
55 |
*/ |
|
56 |
function wp_underscore_video_template() { |
|
57 |
$video_types = wp_get_video_extensions(); |
|
9 | 58 |
?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
<# var w_rule = '', classes = [], |
5 | 60 |
w, h, settings = wp.media.view.settings, |
61 |
isYouTube = isVimeo = false; |
|
62 |
||
63 |
if ( ! _.isEmpty( data.model.src ) ) { |
|
64 |
isYouTube = data.model.src.match(/youtube|youtu\.be/); |
|
65 |
isVimeo = -1 !== data.model.src.indexOf('vimeo'); |
|
66 |
} |
|
67 |
||
68 |
if ( settings.contentWidth && data.model.width >= settings.contentWidth ) { |
|
69 |
w = settings.contentWidth; |
|
70 |
} else { |
|
71 |
w = data.model.width; |
|
72 |
} |
|
73 |
||
74 |
if ( w !== data.model.width ) { |
|
75 |
h = Math.ceil( ( data.model.height * w ) / data.model.width ); |
|
76 |
} else { |
|
77 |
h = data.model.height; |
|
9 | 78 |
} |
5 | 79 |
|
80 |
if ( w ) { |
|
81 |
w_rule = 'width: ' + w + 'px; '; |
|
82 |
} |
|
83 |
||
84 |
if ( isYouTube ) { |
|
85 |
classes.push( 'youtube-video' ); |
|
86 |
} |
|
87 |
||
88 |
if ( isVimeo ) { |
|
89 |
classes.push( 'vimeo-video' ); |
|
90 |
} |
|
91 |
||
92 |
#> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
93 |
<div style="{{ w_rule }}" class="wp-video"> |
5 | 94 |
<video controls |
95 |
class="wp-video-shortcode {{ classes.join( ' ' ) }}" |
|
96 |
<# if ( w ) { #>width="{{ w }}"<# } #> |
|
97 |
<# if ( h ) { #>height="{{ h }}"<# } #> |
|
98 |
<?php |
|
9 | 99 |
$props = array( |
100 |
'poster' => '', |
|
101 |
'preload' => 'metadata', |
|
102 |
); |
|
103 |
foreach ( $props as $key => $value ) : |
|
5 | 104 |
if ( empty( $value ) ) { |
9 | 105 |
?> |
106 |
<# |
|
107 |
if ( ! _.isUndefined( data.model.<?php echo $key; ?> ) && data.model.<?php echo $key; ?> ) { |
|
108 |
#> <?php echo $key; ?>="{{ data.model.<?php echo $key; ?> }}"<# |
|
5 | 109 |
} #> |
9 | 110 |
<?php |
111 |
} else { |
|
112 |
echo $key |
|
113 |
?> |
|
114 |
="{{ _.isUndefined( data.model.<?php echo $key; ?> ) ? '<?php echo $value; ?>' : data.model.<?php echo $key; ?> }}" |
|
115 |
<?php |
|
5 | 116 |
} |
117 |
endforeach; |
|
9 | 118 |
?> |
119 |
<# |
|
120 |
<?php |
|
121 |
foreach ( array( 'autoplay', 'loop' ) as $attr ) : |
|
122 |
?> |
|
123 |
if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) { |
|
124 |
#> <?php echo $attr; ?><# |
|
5 | 125 |
} |
19 | 126 |
<?php endforeach; ?>#> |
5 | 127 |
> |
128 |
<# if ( ! _.isEmpty( data.model.src ) ) { |
|
129 |
if ( isYouTube ) { #> |
|
130 |
<source src="{{ data.model.src }}" type="video/youtube" /> |
|
131 |
<# } else if ( isVimeo ) { #> |
|
132 |
<source src="{{ data.model.src }}" type="video/vimeo" /> |
|
133 |
<# } else { #> |
|
134 |
<source src="{{ data.model.src }}" type="{{ settings.embedMimes[ data.model.src.split('.').pop() ] }}" /> |
|
135 |
<# } |
|
136 |
} #> |
|
137 |
||
9 | 138 |
<?php |
139 |
foreach ( $video_types as $type ) : |
|
140 |
?> |
|
141 |
<# if ( data.model.<?php echo $type; ?> ) { #> |
|
142 |
<source src="{{ data.model.<?php echo $type; ?> }}" type="{{ settings.embedMimes[ '<?php echo $type; ?>' ] }}" /> |
|
5 | 143 |
<# } #> |
144 |
<?php endforeach; ?> |
|
145 |
{{{ data.model.content }}} |
|
146 |
</video> |
|
147 |
</div> |
|
9 | 148 |
<?php |
5 | 149 |
} |
150 |
||
151 |
/** |
|
0 | 152 |
* Prints the templates used in the media manager. |
153 |
* |
|
154 |
* @since 3.5.0 |
|
155 |
*/ |
|
156 |
function wp_print_media_templates() { |
|
157 |
$class = 'media-modal wp-core-ui'; |
|
9 | 158 |
|
159 |
$alt_text_description = sprintf( |
|
16 | 160 |
/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */ |
19 | 161 |
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ), |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
162 |
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
163 |
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ), |
18 | 164 |
'target="_blank" rel="noopener"', |
9 | 165 |
sprintf( |
166 |
'<span class="screen-reader-text"> %s</span>', |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
167 |
/* translators: Hidden accessibility text. */ |
9 | 168 |
__( '(opens in a new tab)' ) |
169 |
) |
|
170 |
); |
|
0 | 171 |
?> |
16 | 172 |
|
173 |
<?php // Template for the media frame: used both in the media grid and in the media modal. ?> |
|
0 | 174 |
<script type="text/html" id="tmpl-media-frame"> |
9 | 175 |
<div class="media-frame-title" id="media-frame-title"></div> |
16 | 176 |
<h2 class="media-frame-menu-heading"><?php _ex( 'Actions', 'media modal menu actions' ); ?></h2> |
177 |
<button type="button" class="button button-link media-frame-menu-toggle" aria-expanded="false"> |
|
178 |
<?php _ex( 'Menu', 'media modal menu' ); ?> |
|
179 |
<span class="dashicons dashicons-arrow-down" aria-hidden="true"></span> |
|
180 |
</button> |
|
0 | 181 |
<div class="media-frame-menu"></div> |
16 | 182 |
<div class="media-frame-tab-panel"> |
183 |
<div class="media-frame-router"></div> |
|
184 |
<div class="media-frame-content"></div> |
|
185 |
</div> |
|
186 |
<h2 class="media-frame-actions-heading screen-reader-text"> |
|
187 |
<?php |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
188 |
/* translators: Hidden accessibility text. */ |
16 | 189 |
_e( 'Selected media actions' ); |
190 |
?> |
|
191 |
</h2> |
|
0 | 192 |
<div class="media-frame-toolbar"></div> |
193 |
<div class="media-frame-uploader"></div> |
|
194 |
</script> |
|
195 |
||
16 | 196 |
<?php // Template for the media modal. ?> |
0 | 197 |
<script type="text/html" id="tmpl-media-modal"> |
16 | 198 |
<div tabindex="0" class="<?php echo $class; ?>" role="dialog" aria-labelledby="media-frame-title"> |
9 | 199 |
<# if ( data.hasCloseButton ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
200 |
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
201 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
202 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
203 |
_e( 'Close dialog' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
204 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
205 |
</span></span></button> |
9 | 206 |
<# } #> |
207 |
<div class="media-modal-content" role="document"></div> |
|
0 | 208 |
</div> |
209 |
<div class="media-modal-backdrop"></div> |
|
210 |
</script> |
|
211 |
||
16 | 212 |
<?php // Template for the window uploader, used for example in the media grid. ?> |
0 | 213 |
<script type="text/html" id="tmpl-uploader-window"> |
214 |
<div class="uploader-window-content"> |
|
16 | 215 |
<div class="uploader-editor-title"><?php _e( 'Drop files to upload' ); ?></div> |
0 | 216 |
</div> |
217 |
</script> |
|
218 |
||
16 | 219 |
<?php // Template for the editor uploader. ?> |
5 | 220 |
<script type="text/html" id="tmpl-uploader-editor"> |
221 |
<div class="uploader-editor-content"> |
|
222 |
<div class="uploader-editor-title"><?php _e( 'Drop files to upload' ); ?></div> |
|
223 |
</div> |
|
224 |
</script> |
|
225 |
||
16 | 226 |
<?php // Template for the inline uploader, used for example in the Media Library admin page - Add New. ?> |
0 | 227 |
<script type="text/html" id="tmpl-uploader-inline"> |
228 |
<# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #> |
|
5 | 229 |
<# if ( data.canClose ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
230 |
<button class="close dashicons dashicons-no"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
231 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
232 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
233 |
_e( 'Close uploader' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
234 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
235 |
</span></button> |
5 | 236 |
<# } #> |
0 | 237 |
<div class="uploader-inline-content {{ messageClass }}"> |
238 |
<# if ( data.message ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
239 |
<h2 class="upload-message">{{ data.message }}</h2> |
0 | 240 |
<# } #> |
241 |
<?php if ( ! _device_can_upload() ) : ?> |
|
16 | 242 |
<div class="upload-ui"> |
243 |
<h2 class="upload-instructions"><?php _e( 'Your browser cannot upload files' ); ?></h2> |
|
244 |
<p> |
|
245 |
<?php |
|
246 |
printf( |
|
247 |
/* translators: %s: https://apps.wordpress.org/ */ |
|
248 |
__( 'The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.' ), |
|
249 |
'https://apps.wordpress.org/' |
|
250 |
); |
|
251 |
?> |
|
252 |
</p> |
|
253 |
</div> |
|
0 | 254 |
<?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?> |
16 | 255 |
<div class="upload-ui"> |
256 |
<h2 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h2> |
|
257 |
<?php |
|
258 |
/** This action is documented in wp-admin/includes/media.php */ |
|
259 |
do_action( 'upload_ui_over_quota' ); |
|
260 |
?> |
|
261 |
</div> |
|
0 | 262 |
<?php else : ?> |
263 |
<div class="upload-ui"> |
|
16 | 264 |
<h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files to upload' ); ?></h2> |
5 | 265 |
<p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p> |
18 | 266 |
<button type="button" class="browser button button-hero" aria-labelledby="post-upload-info"><?php _e( 'Select Files' ); ?></button> |
0 | 267 |
</div> |
268 |
||
269 |
<div class="upload-inline-status"></div> |
|
270 |
||
18 | 271 |
<div class="post-upload-ui" id="post-upload-info"> |
0 | 272 |
<?php |
5 | 273 |
/** This action is documented in wp-admin/includes/media.php */ |
16 | 274 |
do_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
5 | 275 |
/** This action is documented in wp-admin/includes/media.php */ |
16 | 276 |
do_action( 'pre-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
0 | 277 |
|
278 |
if ( 10 === remove_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ) ) { |
|
5 | 279 |
/** This action is documented in wp-admin/includes/media.php */ |
16 | 280 |
do_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
0 | 281 |
add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ); |
282 |
} else { |
|
5 | 283 |
/** This action is documented in wp-admin/includes/media.php */ |
16 | 284 |
do_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
0 | 285 |
} |
286 |
||
5 | 287 |
$max_upload_size = wp_max_upload_size(); |
288 |
if ( ! $max_upload_size ) { |
|
289 |
$max_upload_size = 0; |
|
0 | 290 |
} |
291 |
?> |
|
292 |
||
9 | 293 |
<p class="max-upload-size"> |
294 |
<?php |
|
16 | 295 |
printf( |
296 |
/* translators: %s: Maximum allowed file size. */ |
|
297 |
__( 'Maximum upload file size: %s.' ), |
|
298 |
esc_html( size_format( $max_upload_size ) ) |
|
299 |
); |
|
9 | 300 |
?> |
301 |
</p> |
|
0 | 302 |
|
5 | 303 |
<# if ( data.suggestedWidth && data.suggestedHeight ) { #> |
304 |
<p class="suggested-dimensions"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
305 |
<?php |
16 | 306 |
/* translators: 1: Suggested width number, 2: Suggested height number. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
307 |
printf( __( 'Suggested image dimensions: %1$s by %2$s pixels.' ), '{{data.suggestedWidth}}', '{{data.suggestedHeight}}' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
308 |
?> |
5 | 309 |
</p> |
310 |
<# } #> |
|
0 | 311 |
|
5 | 312 |
<?php |
313 |
/** This action is documented in wp-admin/includes/media.php */ |
|
16 | 314 |
do_action( 'post-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
9 | 315 |
?> |
0 | 316 |
</div> |
317 |
<?php endif; ?> |
|
318 |
</div> |
|
319 |
</script> |
|
320 |
||
16 | 321 |
<?php // Template for the view switchers, used for example in the Media Grid. ?> |
5 | 322 |
<script type="text/html" id="tmpl-media-library-view-switcher"> |
18 | 323 |
<a href="<?php echo esc_url( add_query_arg( 'mode', 'list', admin_url( 'upload.php' ) ) ); ?>" class="view-list"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
324 |
<span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
325 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
326 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
327 |
_e( 'List view' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
328 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
329 |
</span> |
5 | 330 |
</a> |
18 | 331 |
<a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', admin_url( 'upload.php' ) ) ); ?>" class="view-grid current" aria-current="page"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
332 |
<span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
333 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
334 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
335 |
_e( 'Grid view' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
336 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
337 |
</span> |
5 | 338 |
</a> |
339 |
</script> |
|
340 |
||
16 | 341 |
<?php // Template for the uploading status UI. ?> |
0 | 342 |
<script type="text/html" id="tmpl-uploader-status"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
343 |
<h2><?php _e( 'Uploading' ); ?></h2> |
0 | 344 |
|
345 |
<div class="media-progress-bar"><div></div></div> |
|
346 |
<div class="upload-details"> |
|
347 |
<span class="upload-count"> |
|
348 |
<span class="upload-index"></span> / <span class="upload-total"></span> |
|
349 |
</span> |
|
350 |
<span class="upload-detail-separator">–</span> |
|
351 |
<span class="upload-filename"></span> |
|
352 |
</div> |
|
353 |
<div class="upload-errors"></div> |
|
19 | 354 |
<button type="button" class="button upload-dismiss-errors"><?php _e( 'Dismiss errors' ); ?></button> |
0 | 355 |
</script> |
356 |
||
16 | 357 |
<?php // Template for the uploading status errors. ?> |
0 | 358 |
<script type="text/html" id="tmpl-uploader-status-error"> |
359 |
<span class="upload-error-filename">{{{ data.filename }}}</span> |
|
360 |
<span class="upload-error-message">{{ data.message }}</span> |
|
361 |
</script> |
|
362 |
||
16 | 363 |
<?php // Template for the Attachment Details layout in the media browser. ?> |
5 | 364 |
<script type="text/html" id="tmpl-edit-attachment-frame"> |
365 |
<div class="edit-media-header"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
366 |
<button class="left dashicons"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Edit previous media item' ); ?></span></button> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
367 |
<button class="right dashicons"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Edit next media item' ); ?></span></button> |
9 | 368 |
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button> |
5 | 369 |
</div> |
370 |
<div class="media-frame-title"></div> |
|
371 |
<div class="media-frame-content"></div> |
|
372 |
</script> |
|
373 |
||
16 | 374 |
<?php // Template for the Attachment Details two columns layout. ?> |
5 | 375 |
<script type="text/html" id="tmpl-attachment-details-two-column"> |
376 |
<div class="attachment-media-view {{ data.orientation }}"> |
|
21
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 |
if ( isset( $_GET['error'] ) && 'deprecated' === $_GET['error'] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
379 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
380 |
__( 'The Edit Media screen is deprecated as of WordPress 6.3. Please use the Media Library instead.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
381 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
382 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
383 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
384 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
385 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
386 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
387 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
388 |
<h2 class="screen-reader-text"><?php /* translators: Hidden accessibility text. */ _e( 'Attachment Preview' ); ?></h2> |
5 | 389 |
<div class="thumbnail thumbnail-{{ data.type }}"> |
390 |
<# if ( data.uploading ) { #> |
|
391 |
<div class="media-progress-bar"><div></div></div> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
392 |
<# } else if ( data.sizes && data.sizes.full ) { #> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
393 |
<img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" alt="" /> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
394 |
<# } else if ( data.sizes && data.sizes.large ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
395 |
<img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" alt="" /> |
5 | 396 |
<# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
397 |
<img class="details-image icon" src="{{ data.icon }}" draggable="false" alt="" /> |
5 | 398 |
<# } #> |
399 |
||
400 |
<# if ( 'audio' === data.type ) { #> |
|
18 | 401 |
<div class="wp-media-wrapper wp-audio"> |
5 | 402 |
<audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none"> |
18 | 403 |
<source type="{{ data.mime }}" src="{{ data.url }}" /> |
5 | 404 |
</audio> |
405 |
</div> |
|
406 |
<# } else if ( 'video' === data.type ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
407 |
var w_rule = ''; |
5 | 408 |
if ( data.width ) { |
409 |
w_rule = 'width: ' + data.width + 'px;'; |
|
410 |
} else if ( wp.media.view.settings.contentWidth ) { |
|
411 |
w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; |
|
412 |
} |
|
413 |
#> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
414 |
<div style="{{ w_rule }}" class="wp-media-wrapper wp-video"> |
5 | 415 |
<video controls="controls" class="wp-video-shortcode" preload="metadata" |
416 |
<# if ( data.width ) { #>width="{{ data.width }}"<# } #> |
|
417 |
<# if ( data.height ) { #>height="{{ data.height }}"<# } #> |
|
418 |
<# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>> |
|
18 | 419 |
<source type="{{ data.mime }}" src="{{ data.url }}" /> |
5 | 420 |
</video> |
421 |
</div> |
|
422 |
<# } #> |
|
423 |
||
424 |
<div class="attachment-actions"> |
|
425 |
<# if ( 'image' === data.type && ! data.uploading && data.sizes && data.can.save ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
426 |
<button type="button" class="button edit-attachment"><?php _e( 'Edit Image' ); ?></button> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
427 |
<# } else if ( 'pdf' === data.subtype && data.sizes ) { #> |
16 | 428 |
<p><?php _e( 'Document Preview' ); ?></p> |
5 | 429 |
<# } #> |
430 |
</div> |
|
431 |
</div> |
|
432 |
</div> |
|
433 |
<div class="attachment-info"> |
|
16 | 434 |
<span class="settings-save-status" role="status"> |
5 | 435 |
<span class="spinner"></span> |
9 | 436 |
<span class="saved"><?php esc_html_e( 'Saved.' ); ?></span> |
5 | 437 |
</span> |
438 |
<div class="details"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
439 |
<h2 class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
440 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
441 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
442 |
_e( 'Details' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
443 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
444 |
</h2> |
18 | 445 |
<div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div> |
446 |
<div class="uploaded-by"> |
|
447 |
<strong><?php _e( 'Uploaded by:' ); ?></strong> |
|
448 |
<# if ( data.authorLink ) { #> |
|
449 |
<a href="{{ data.authorLink }}">{{ data.authorName }}</a> |
|
450 |
<# } else { #> |
|
451 |
{{ data.authorName }} |
|
452 |
<# } #> |
|
453 |
</div> |
|
454 |
<# if ( data.uploadedToTitle ) { #> |
|
455 |
<div class="uploaded-to"> |
|
456 |
<strong><?php _e( 'Uploaded to:' ); ?></strong> |
|
457 |
<# if ( data.uploadedToLink ) { #> |
|
458 |
<a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a> |
|
459 |
<# } else { #> |
|
460 |
{{ data.uploadedToTitle }} |
|
461 |
<# } #> |
|
462 |
</div> |
|
463 |
<# } #> |
|
5 | 464 |
<div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div> |
18 | 465 |
<div class="file-type"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div> |
5 | 466 |
<div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div> |
467 |
<# if ( 'image' === data.type && ! data.uploading ) { #> |
|
468 |
<# if ( data.width && data.height ) { #> |
|
9 | 469 |
<div class="dimensions"><strong><?php _e( 'Dimensions:' ); ?></strong> |
470 |
<?php |
|
16 | 471 |
/* translators: 1: A number of pixels wide, 2: A number of pixels tall. */ |
9 | 472 |
printf( __( '%1$s by %2$s pixels' ), '{{ data.width }}', '{{ data.height }}' ); |
473 |
?> |
|
474 |
</div> |
|
5 | 475 |
<# } #> |
16 | 476 |
|
477 |
<# if ( data.originalImageURL && data.originalImageName ) { #> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
478 |
<div class="word-wrap-break-word"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
479 |
<strong><?php _e( 'Original image:' ); ?></strong> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
480 |
<a href="{{ data.originalImageURL }}">{{data.originalImageName}}</a> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
481 |
</div> |
16 | 482 |
<# } #> |
5 | 483 |
<# } #> |
484 |
||
9 | 485 |
<# if ( data.fileLength && data.fileLengthHumanReadable ) { #> |
486 |
<div class="file-length"><strong><?php _e( 'Length:' ); ?></strong> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
487 |
<span aria-hidden="true">{{ data.fileLengthHumanReadable }}</span> |
9 | 488 |
<span class="screen-reader-text">{{ data.fileLengthHumanReadable }}</span> |
489 |
</div> |
|
5 | 490 |
<# } #> |
491 |
||
492 |
<# if ( 'audio' === data.type && data.meta.bitrate ) { #> |
|
493 |
<div class="bitrate"> |
|
494 |
<strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s |
|
495 |
<# if ( data.meta.bitrate_mode ) { #> |
|
496 |
{{ ' ' + data.meta.bitrate_mode.toUpperCase() }} |
|
497 |
<# } #> |
|
0 | 498 |
</div> |
5 | 499 |
<# } #> |
500 |
||
18 | 501 |
<# if ( data.mediaStates ) { #> |
502 |
<div class="media-states"><strong><?php _e( 'Used as:' ); ?></strong> {{ data.mediaStates }}</div> |
|
503 |
<# } #> |
|
504 |
||
5 | 505 |
<div class="compat-meta"> |
506 |
<# if ( data.compat && data.compat.meta ) { #> |
|
507 |
{{{ data.compat.meta }}} |
|
508 |
<# } #> |
|
0 | 509 |
</div> |
5 | 510 |
</div> |
0 | 511 |
|
5 | 512 |
<div class="settings"> |
513 |
<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> |
|
9 | 514 |
<# if ( 'image' === data.type ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
515 |
<span class="setting alt-text has-description" data-setting="alt"> |
16 | 516 |
<label for="attachment-details-two-column-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
517 |
<textarea id="attachment-details-two-column-alt-text" aria-describedby="alt-text-description" {{ maybeReadOnly }}>{{ data.alt }}</textarea> |
16 | 518 |
</span> |
9 | 519 |
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p> |
520 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
521 |
<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> |
16 | 522 |
<span class="setting" data-setting="title"> |
523 |
<label for="attachment-details-two-column-title" class="name"><?php _e( 'Title' ); ?></label> |
|
524 |
<input type="text" id="attachment-details-two-column-title" value="{{ data.title }}" {{ maybeReadOnly }} /> |
|
525 |
</span> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
526 |
<?php endif; ?> |
5 | 527 |
<# if ( 'audio' === data.type ) { #> |
9 | 528 |
<?php |
529 |
foreach ( array( |
|
5 | 530 |
'artist' => __( 'Artist' ), |
9 | 531 |
'album' => __( 'Album' ), |
532 |
) as $key => $label ) : |
|
533 |
?> |
|
16 | 534 |
<span class="setting" data-setting="<?php echo esc_attr( $key ); ?>"> |
535 |
<label for="attachment-details-two-column-<?php echo esc_attr( $key ); ?>" class="name"><?php echo $label; ?></label> |
|
536 |
<input type="text" id="attachment-details-two-column-<?php echo esc_attr( $key ); ?>" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" /> |
|
537 |
</span> |
|
5 | 538 |
<?php endforeach; ?> |
539 |
<# } #> |
|
16 | 540 |
<span class="setting" data-setting="caption"> |
541 |
<label for="attachment-details-two-column-caption" class="name"><?php _e( 'Caption' ); ?></label> |
|
542 |
<textarea id="attachment-details-two-column-caption" {{ maybeReadOnly }}>{{ data.caption }}</textarea> |
|
543 |
</span> |
|
544 |
<span class="setting" data-setting="description"> |
|
545 |
<label for="attachment-details-two-column-description" class="name"><?php _e( 'Description' ); ?></label> |
|
546 |
<textarea id="attachment-details-two-column-description" {{ maybeReadOnly }}>{{ data.description }}</textarea> |
|
547 |
</span> |
|
548 |
<span class="setting" data-setting="url"> |
|
549 |
<label for="attachment-details-two-column-copy-link" class="name"><?php _e( 'File URL:' ); ?></label> |
|
550 |
<input type="text" class="attachment-details-copy-link" id="attachment-details-two-column-copy-link" value="{{ data.url }}" readonly /> |
|
551 |
<span class="copy-to-clipboard-container"> |
|
18 | 552 |
<button type="button" class="button button-small copy-attachment-url" data-clipboard-target="#attachment-details-two-column-copy-link"><?php _e( 'Copy URL to clipboard' ); ?></button> |
16 | 553 |
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> |
554 |
</span> |
|
555 |
</span> |
|
5 | 556 |
<div class="attachment-compat"></div> |
557 |
</div> |
|
558 |
||
559 |
<div class="actions"> |
|
18 | 560 |
<# if ( data.link ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
561 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
562 |
$view_media_text = ( '1' === get_option( 'wp_attachment_pages_enabled' ) ) ? __( 'View attachment page' ) : __( 'View media file' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
563 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
564 |
<a class="view-attachment" href="{{ data.link }}"><?php echo $view_media_text; ?></a> |
18 | 565 |
<# } #> |
566 |
<# if ( data.can.save ) { #> |
|
567 |
<# if ( data.link ) { #> |
|
568 |
<span class="links-separator">|</span> |
|
569 |
<# } #> |
|
9 | 570 |
<a href="{{ data.editLink }}"><?php _e( 'Edit more details' ); ?></a> |
5 | 571 |
<# } #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
572 |
<# if ( data.can.save && data.link ) { #> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
573 |
<span class="links-separator">|</span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
574 |
<a href="{{ data.url }}" download><?php _e( 'Download file' ); ?></a> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
575 |
<# } #> |
18 | 576 |
<# if ( ! data.uploading && data.can.remove ) { #> |
577 |
<# if ( data.link || data.can.save ) { #> |
|
578 |
<span class="links-separator">|</span> |
|
579 |
<# } #> |
|
9 | 580 |
<?php if ( MEDIA_TRASH ) : ?> |
5 | 581 |
<# if ( 'trash' === data.status ) { #> |
9 | 582 |
<button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button> |
5 | 583 |
<# } else { #> |
9 | 584 |
<button type="button" class="button-link trash-attachment"><?php _e( 'Move to Trash' ); ?></button> |
5 | 585 |
<# } #> |
9 | 586 |
<?php else : ?> |
16 | 587 |
<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' ); ?></button> |
5 | 588 |
<?php endif; ?> |
589 |
<# } #> |
|
590 |
</div> |
|
591 |
</div> |
|
592 |
</script> |
|
593 |
||
16 | 594 |
<?php // Template for the Attachment "thumbnails" in the Media Grid. ?> |
5 | 595 |
<script type="text/html" id="tmpl-attachment"> |
596 |
<div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}"> |
|
597 |
<div class="thumbnail"> |
|
598 |
<# if ( data.uploading ) { #> |
|
599 |
<div class="media-progress-bar"><div style="width: {{ data.percent }}%"></div></div> |
|
18 | 600 |
<# } else if ( 'image' === data.type && data.size && data.size.url ) { #> |
5 | 601 |
<div class="centered"> |
602 |
<img src="{{ data.size.url }}" draggable="false" alt="" /> |
|
603 |
</div> |
|
604 |
<# } else { #> |
|
605 |
<div class="centered"> |
|
606 |
<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
607 |
<img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
608 |
<# } else if ( data.sizes && data.sizes.medium ) { #> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
609 |
<img src="{{ data.sizes.medium.url }}" class="thumbnail" draggable="false" alt="" /> |
5 | 610 |
<# } else { #> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
611 |
<img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> |
5 | 612 |
<# } #> |
613 |
</div> |
|
614 |
<div class="filename"> |
|
615 |
<div>{{ data.filename }}</div> |
|
616 |
</div> |
|
617 |
<# } #> |
|
618 |
</div> |
|
0 | 619 |
<# if ( data.buttons.close ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
620 |
<button type="button" class="button-link attachment-close media-modal-icon"><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
621 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
622 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
623 |
_e( 'Remove' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
624 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
625 |
</span></button> |
0 | 626 |
<# } #> |
627 |
</div> |
|
5 | 628 |
<# if ( data.buttons.check ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
629 |
<button type="button" class="check" tabindex="-1"><span class="media-modal-icon"></span><span class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
630 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
631 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
632 |
_e( 'Deselect' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
633 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
634 |
</span></button> |
5 | 635 |
<# } #> |
0 | 636 |
<# |
637 |
var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; |
|
5 | 638 |
if ( data.describe ) { |
639 |
if ( 'image' === data.type ) { #> |
|
0 | 640 |
<input type="text" value="{{ data.caption }}" class="describe" data-setting="caption" |
16 | 641 |
aria-label="<?php esc_attr_e( 'Caption' ); ?>" |
642 |
placeholder="<?php esc_attr_e( 'Caption…' ); ?>" {{ maybeReadOnly }} /> |
|
0 | 643 |
<# } else { #> |
644 |
<input type="text" value="{{ data.title }}" class="describe" data-setting="title" |
|
645 |
<# if ( 'video' === data.type ) { #> |
|
16 | 646 |
aria-label="<?php esc_attr_e( 'Video title' ); ?>" |
647 |
placeholder="<?php esc_attr_e( 'Video title…' ); ?>" |
|
0 | 648 |
<# } else if ( 'audio' === data.type ) { #> |
16 | 649 |
aria-label="<?php esc_attr_e( 'Audio title' ); ?>" |
650 |
placeholder="<?php esc_attr_e( 'Audio title…' ); ?>" |
|
0 | 651 |
<# } else { #> |
16 | 652 |
aria-label="<?php esc_attr_e( 'Media title' ); ?>" |
653 |
placeholder="<?php esc_attr_e( 'Media title…' ); ?>" |
|
0 | 654 |
<# } #> {{ maybeReadOnly }} /> |
5 | 655 |
<# } |
656 |
} #> |
|
0 | 657 |
</script> |
658 |
||
16 | 659 |
<?php // Template for the Attachment details, used for example in the sidebar. ?> |
0 | 660 |
<script type="text/html" id="tmpl-attachment-details"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
661 |
<h2> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
662 |
<?php _e( 'Attachment Details' ); ?> |
16 | 663 |
<span class="settings-save-status" role="status"> |
0 | 664 |
<span class="spinner"></span> |
9 | 665 |
<span class="saved"><?php esc_html_e( 'Saved.' ); ?></span> |
0 | 666 |
</span> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
667 |
</h2> |
0 | 668 |
<div class="attachment-info"> |
18 | 669 |
|
670 |
<# if ( 'audio' === data.type ) { #> |
|
671 |
<div class="wp-media-wrapper wp-audio"> |
|
672 |
<audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none"> |
|
673 |
<source type="{{ data.mime }}" src="{{ data.url }}" /> |
|
674 |
</audio> |
|
675 |
</div> |
|
676 |
<# } else if ( 'video' === data.type ) { |
|
677 |
var w_rule = ''; |
|
678 |
if ( data.width ) { |
|
679 |
w_rule = 'width: ' + data.width + 'px;'; |
|
680 |
} else if ( wp.media.view.settings.contentWidth ) { |
|
681 |
w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; |
|
682 |
} |
|
683 |
#> |
|
684 |
<div style="{{ w_rule }}" class="wp-media-wrapper wp-video"> |
|
685 |
<video controls="controls" class="wp-video-shortcode" preload="metadata" |
|
686 |
<# if ( data.width ) { #>width="{{ data.width }}"<# } #> |
|
687 |
<# if ( data.height ) { #>height="{{ data.height }}"<# } #> |
|
688 |
<# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>> |
|
689 |
<source type="{{ data.mime }}" src="{{ data.url }}" /> |
|
690 |
</video> |
|
691 |
</div> |
|
692 |
<# } else { #> |
|
693 |
<div class="thumbnail thumbnail-{{ data.type }}"> |
|
694 |
<# if ( data.uploading ) { #> |
|
695 |
<div class="media-progress-bar"><div></div></div> |
|
696 |
<# } else if ( 'image' === data.type && data.size && data.size.url ) { #> |
|
697 |
<img src="{{ data.size.url }}" draggable="false" alt="" /> |
|
698 |
<# } else { #> |
|
699 |
<img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> |
|
700 |
<# } #> |
|
701 |
</div> |
|
702 |
<# } #> |
|
703 |
||
0 | 704 |
<div class="details"> |
705 |
<div class="filename">{{ data.filename }}</div> |
|
706 |
<div class="uploaded">{{ data.dateFormatted }}</div> |
|
707 |
||
5 | 708 |
<div class="file-size">{{ data.filesizeHumanReadable }}</div> |
0 | 709 |
<# if ( 'image' === data.type && ! data.uploading ) { #> |
710 |
<# if ( data.width && data.height ) { #> |
|
9 | 711 |
<div class="dimensions"> |
712 |
<?php |
|
16 | 713 |
/* translators: 1: A number of pixels wide, 2: A number of pixels tall. */ |
9 | 714 |
printf( __( '%1$s by %2$s pixels' ), '{{ data.width }}', '{{ data.height }}' ); |
715 |
?> |
|
716 |
</div> |
|
0 | 717 |
<# } #> |
718 |
||
16 | 719 |
<# if ( data.originalImageURL && data.originalImageName ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
720 |
<div class="word-wrap-break-word"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
721 |
<?php _e( 'Original image:' ); ?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
722 |
<a href="{{ data.originalImageURL }}">{{data.originalImageName}}</a> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
723 |
</div> |
16 | 724 |
<# } #> |
725 |
||
5 | 726 |
<# if ( data.can.save && data.sizes ) { #> |
0 | 727 |
<a class="edit-attachment" href="{{ data.editLink }}&image-editor" target="_blank"><?php _e( 'Edit Image' ); ?></a> |
728 |
<# } #> |
|
729 |
<# } #> |
|
730 |
||
9 | 731 |
<# if ( data.fileLength && data.fileLengthHumanReadable ) { #> |
732 |
<div class="file-length"><?php _e( 'Length:' ); ?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
733 |
<span aria-hidden="true">{{ data.fileLengthHumanReadable }}</span> |
9 | 734 |
<span class="screen-reader-text">{{ data.fileLengthHumanReadable }}</span> |
735 |
</div> |
|
0 | 736 |
<# } #> |
737 |
||
18 | 738 |
<# if ( data.mediaStates ) { #> |
739 |
<div class="media-states"><strong><?php _e( 'Used as:' ); ?></strong> {{ data.mediaStates }}</div> |
|
740 |
<# } #> |
|
741 |
||
0 | 742 |
<# if ( ! data.uploading && data.can.remove ) { #> |
9 | 743 |
<?php if ( MEDIA_TRASH ) : ?> |
5 | 744 |
<# if ( 'trash' === data.status ) { #> |
9 | 745 |
<button type="button" class="button-link untrash-attachment"><?php _e( 'Restore from Trash' ); ?></button> |
5 | 746 |
<# } else { #> |
9 | 747 |
<button type="button" class="button-link trash-attachment"><?php _e( 'Move to Trash' ); ?></button> |
5 | 748 |
<# } #> |
9 | 749 |
<?php else : ?> |
16 | 750 |
<button type="button" class="button-link delete-attachment"><?php _e( 'Delete permanently' ); ?></button> |
5 | 751 |
<?php endif; ?> |
0 | 752 |
<# } #> |
753 |
||
754 |
<div class="compat-meta"> |
|
755 |
<# if ( data.compat && data.compat.meta ) { #> |
|
756 |
{{{ data.compat.meta }}} |
|
757 |
<# } #> |
|
758 |
</div> |
|
759 |
</div> |
|
760 |
</div> |
|
761 |
<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #> |
|
9 | 762 |
<# if ( 'image' === data.type ) { #> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
763 |
<span class="setting alt-text has-description" data-setting="alt"> |
16 | 764 |
<label for="attachment-details-alt-text" class="name"><?php _e( 'Alt Text' ); ?></label> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
765 |
<textarea id="attachment-details-alt-text" aria-describedby="alt-text-description" {{ maybeReadOnly }}>{{ data.alt }}</textarea> |
16 | 766 |
</span> |
9 | 767 |
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p> |
768 |
<# } #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
769 |
<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?> |
16 | 770 |
<span class="setting" data-setting="title"> |
771 |
<label for="attachment-details-title" class="name"><?php _e( 'Title' ); ?></label> |
|
772 |
<input type="text" id="attachment-details-title" value="{{ data.title }}" {{ maybeReadOnly }} /> |
|
773 |
</span> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
774 |
<?php endif; ?> |
5 | 775 |
<# if ( 'audio' === data.type ) { #> |
9 | 776 |
<?php |
777 |
foreach ( array( |
|
5 | 778 |
'artist' => __( 'Artist' ), |
9 | 779 |
'album' => __( 'Album' ), |
780 |
) as $key => $label ) : |
|
781 |
?> |
|
16 | 782 |
<span class="setting" data-setting="<?php echo esc_attr( $key ); ?>"> |
783 |
<label for="attachment-details-<?php echo esc_attr( $key ); ?>" class="name"><?php echo $label; ?></label> |
|
784 |
<input type="text" id="attachment-details-<?php echo esc_attr( $key ); ?>" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" /> |
|
785 |
</span> |
|
5 | 786 |
<?php endforeach; ?> |
787 |
<# } #> |
|
16 | 788 |
<span class="setting" data-setting="caption"> |
789 |
<label for="attachment-details-caption" class="name"><?php _e( 'Caption' ); ?></label> |
|
790 |
<textarea id="attachment-details-caption" {{ maybeReadOnly }}>{{ data.caption }}</textarea> |
|
791 |
</span> |
|
792 |
<span class="setting" data-setting="description"> |
|
793 |
<label for="attachment-details-description" class="name"><?php _e( 'Description' ); ?></label> |
|
794 |
<textarea id="attachment-details-description" {{ maybeReadOnly }}>{{ data.description }}</textarea> |
|
795 |
</span> |
|
796 |
<span class="setting" data-setting="url"> |
|
797 |
<label for="attachment-details-copy-link" class="name"><?php _e( 'File URL:' ); ?></label> |
|
798 |
<input type="text" class="attachment-details-copy-link" id="attachment-details-copy-link" value="{{ data.url }}" readonly /> |
|
799 |
<div class="copy-to-clipboard-container"> |
|
18 | 800 |
<button type="button" class="button button-small copy-attachment-url" data-clipboard-target="#attachment-details-copy-link"><?php _e( 'Copy URL to clipboard' ); ?></button> |
16 | 801 |
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> |
802 |
</div> |
|
803 |
</span> |
|
0 | 804 |
</script> |
805 |
||
16 | 806 |
<?php // Template for the Selection status bar. ?> |
0 | 807 |
<script type="text/html" id="tmpl-media-selection"> |
808 |
<div class="selection-info"> |
|
809 |
<span class="count"></span> |
|
810 |
<# if ( data.editable ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
811 |
<button type="button" class="button-link edit-selection"><?php _e( 'Edit Selection' ); ?></button> |
0 | 812 |
<# } #> |
813 |
<# if ( data.clearable ) { #> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
814 |
<button type="button" class="button-link clear-selection"><?php _e( 'Clear' ); ?></button> |
0 | 815 |
<# } #> |
816 |
</div> |
|
817 |
<div class="selection-view"></div> |
|
818 |
</script> |
|
819 |
||
16 | 820 |
<?php // Template for the Attachment display settings, used for example in the sidebar. ?> |
0 | 821 |
<script type="text/html" id="tmpl-attachment-display-settings"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
822 |
<h2><?php _e( 'Attachment Display Settings' ); ?></h2> |
0 | 823 |
|
824 |
<# if ( 'image' === data.type ) { #> |
|
16 | 825 |
<span class="setting align"> |
826 |
<label for="attachment-display-settings-alignment" class="name"><?php _e( 'Alignment' ); ?></label> |
|
827 |
<select id="attachment-display-settings-alignment" class="alignment" |
|
0 | 828 |
data-setting="align" |
829 |
<# if ( data.userSettings ) { #> |
|
830 |
data-user-setting="align" |
|
831 |
<# } #>> |
|
832 |
||
833 |
<option value="left"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
834 |
<?php esc_html_e( 'Left' ); ?> |
0 | 835 |
</option> |
836 |
<option value="center"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
837 |
<?php esc_html_e( 'Center' ); ?> |
0 | 838 |
</option> |
839 |
<option value="right"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
840 |
<?php esc_html_e( 'Right' ); ?> |
0 | 841 |
</option> |
842 |
<option value="none" selected> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
843 |
<?php echo esc_html_x( 'None', 'Alignment option' ); ?> |
0 | 844 |
</option> |
845 |
</select> |
|
16 | 846 |
</span> |
0 | 847 |
<# } #> |
848 |
||
16 | 849 |
<span class="setting"> |
850 |
<label for="attachment-display-settings-link-to" class="name"> |
|
0 | 851 |
<# if ( data.model.canEmbed ) { #> |
16 | 852 |
<?php _e( 'Embed or Link' ); ?> |
0 | 853 |
<# } else { #> |
16 | 854 |
<?php _e( 'Link To' ); ?> |
0 | 855 |
<# } #> |
16 | 856 |
</label> |
857 |
<select id="attachment-display-settings-link-to" class="link-to" |
|
858 |
data-setting="link" |
|
859 |
<# if ( data.userSettings && ! data.model.canEmbed ) { #> |
|
860 |
data-user-setting="urlbutton" |
|
861 |
<# } #>> |
|
862 |
||
863 |
<# if ( data.model.canEmbed ) { #> |
|
864 |
<option value="embed" selected> |
|
865 |
<?php esc_html_e( 'Embed Media Player' ); ?> |
|
866 |
</option> |
|
867 |
<option value="file"> |
|
868 |
<# } else { #> |
|
869 |
<option value="none" selected> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
870 |
<?php echo esc_html_x( 'None', 'Media item link option' ); ?> |
16 | 871 |
</option> |
872 |
<option value="file"> |
|
873 |
<# } #> |
|
874 |
<# if ( data.model.canEmbed ) { #> |
|
875 |
<?php esc_html_e( 'Link to Media File' ); ?> |
|
876 |
<# } else { #> |
|
877 |
<?php esc_html_e( 'Media File' ); ?> |
|
0 | 878 |
<# } #> |
16 | 879 |
</option> |
880 |
<option value="post"> |
|
881 |
<# if ( data.model.canEmbed ) { #> |
|
882 |
<?php esc_html_e( 'Link to Attachment Page' ); ?> |
|
883 |
<# } else { #> |
|
884 |
<?php esc_html_e( 'Attachment Page' ); ?> |
|
885 |
<# } #> |
|
886 |
</option> |
|
887 |
<# if ( 'image' === data.type ) { #> |
|
888 |
<option value="custom"> |
|
889 |
<?php esc_html_e( 'Custom URL' ); ?> |
|
890 |
</option> |
|
891 |
<# } #> |
|
892 |
</select> |
|
893 |
</span> |
|
894 |
<span class="setting"> |
|
895 |
<label for="attachment-display-settings-link-to-custom" class="name"><?php _e( 'URL' ); ?></label> |
|
896 |
<input type="text" id="attachment-display-settings-link-to-custom" class="link-to-custom" data-setting="linkUrl" /> |
|
897 |
</span> |
|
0 | 898 |
|
899 |
<# if ( 'undefined' !== typeof data.sizes ) { #> |
|
16 | 900 |
<span class="setting"> |
901 |
<label for="attachment-display-settings-size" class="name"><?php _e( 'Size' ); ?></label> |
|
902 |
<select id="attachment-display-settings-size" class="size" name="size" |
|
0 | 903 |
data-setting="size" |
904 |
<# if ( data.userSettings ) { #> |
|
905 |
data-user-setting="imgsize" |
|
906 |
<# } #>> |
|
907 |
<?php |
|
908 |
/** This filter is documented in wp-admin/includes/media.php */ |
|
9 | 909 |
$sizes = apply_filters( |
910 |
'image_size_names_choose', |
|
911 |
array( |
|
912 |
'thumbnail' => __( 'Thumbnail' ), |
|
913 |
'medium' => __( 'Medium' ), |
|
914 |
'large' => __( 'Large' ), |
|
915 |
'full' => __( 'Full Size' ), |
|
916 |
) |
|
917 |
); |
|
0 | 918 |
|
9 | 919 |
foreach ( $sizes as $value => $name ) : |
920 |
?> |
|
0 | 921 |
<# |
922 |
var size = data.sizes['<?php echo esc_js( $value ); ?>']; |
|
923 |
if ( size ) { #> |
|
924 |
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, 'full' ); ?>> |
|
925 |
<?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} |
|
926 |
</option> |
|
927 |
<# } #> |
|
928 |
<?php endforeach; ?> |
|
929 |
</select> |
|
16 | 930 |
</span> |
0 | 931 |
<# } #> |
932 |
</script> |
|
933 |
||
16 | 934 |
<?php // Template for the Gallery settings, used for example in the sidebar. ?> |
0 | 935 |
<script type="text/html" id="tmpl-gallery-settings"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
936 |
<h2><?php _e( 'Gallery Settings' ); ?></h2> |
0 | 937 |
|
16 | 938 |
<span class="setting"> |
939 |
<label for="gallery-settings-link-to" class="name"><?php _e( 'Link To' ); ?></label> |
|
940 |
<select id="gallery-settings-link-to" class="link-to" |
|
0 | 941 |
data-setting="link" |
942 |
<# if ( data.userSettings ) { #> |
|
943 |
data-user-setting="urlbutton" |
|
944 |
<# } #>> |
|
945 |
||
16 | 946 |
<option value="post" <# if ( ! wp.media.galleryDefaults.link || 'post' === wp.media.galleryDefaults.link ) { |
5 | 947 |
#>selected="selected"<# } |
948 |
#>> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
949 |
<?php esc_html_e( 'Attachment Page' ); ?> |
0 | 950 |
</option> |
16 | 951 |
<option value="file" <# if ( 'file' === wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
952 |
<?php esc_html_e( 'Media File' ); ?> |
0 | 953 |
</option> |
16 | 954 |
<option value="none" <# if ( 'none' === wp.media.galleryDefaults.link ) { #>selected="selected"<# } #>> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
955 |
<?php echo esc_html_x( 'None', 'Media item link option' ); ?> |
0 | 956 |
</option> |
957 |
</select> |
|
16 | 958 |
</span> |
0 | 959 |
|
16 | 960 |
<span class="setting"> |
961 |
<label for="gallery-settings-columns" class="name select-label-inline"><?php _e( 'Columns' ); ?></label> |
|
962 |
<select id="gallery-settings-columns" class="columns" name="columns" |
|
0 | 963 |
data-setting="columns"> |
964 |
<?php for ( $i = 1; $i <= 9; $i++ ) : ?> |
|
5 | 965 |
<option value="<?php echo esc_attr( $i ); ?>" <# |
9 | 966 |
if ( <?php echo $i; ?> == wp.media.galleryDefaults.columns ) { #>selected="selected"<# } |
5 | 967 |
#>> |
0 | 968 |
<?php echo esc_html( $i ); ?> |
969 |
</option> |
|
970 |
<?php endfor; ?> |
|
971 |
</select> |
|
16 | 972 |
</span> |
0 | 973 |
|
16 | 974 |
<span class="setting"> |
975 |
<input type="checkbox" id="gallery-settings-random-order" data-setting="_orderbyRandom" /> |
|
976 |
<label for="gallery-settings-random-order" class="checkbox-label-inline"><?php _e( 'Random Order' ); ?></label> |
|
977 |
</span> |
|
5 | 978 |
|
16 | 979 |
<span class="setting size"> |
980 |
<label for="gallery-settings-size" class="name"><?php _e( 'Size' ); ?></label> |
|
981 |
<select id="gallery-settings-size" class="size" name="size" |
|
5 | 982 |
data-setting="size" |
983 |
<# if ( data.userSettings ) { #> |
|
984 |
data-user-setting="imgsize" |
|
985 |
<# } #> |
|
986 |
> |
|
987 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
988 |
/** This filter is documented in wp-admin/includes/media.php */ |
9 | 989 |
$size_names = apply_filters( |
990 |
'image_size_names_choose', |
|
991 |
array( |
|
992 |
'thumbnail' => __( 'Thumbnail' ), |
|
993 |
'medium' => __( 'Medium' ), |
|
994 |
'large' => __( 'Large' ), |
|
995 |
'full' => __( 'Full Size' ), |
|
996 |
) |
|
997 |
); |
|
5 | 998 |
|
9 | 999 |
foreach ( $size_names as $size => $label ) : |
1000 |
?> |
|
5 | 1001 |
<option value="<?php echo esc_attr( $size ); ?>"> |
1002 |
<?php echo esc_html( $label ); ?> |
|
1003 |
</option> |
|
1004 |
<?php endforeach; ?> |
|
1005 |
</select> |
|
16 | 1006 |
</span> |
5 | 1007 |
</script> |
1008 |
||
16 | 1009 |
<?php // Template for the Playlists settings, used for example in the sidebar. ?> |
5 | 1010 |
<script type="text/html" id="tmpl-playlist-settings"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1011 |
<h2><?php _e( 'Playlist Settings' ); ?></h2> |
5 | 1012 |
|
1013 |
<# var emptyModel = _.isEmpty( data.model ), |
|
1014 |
isVideo = 'video' === data.controller.get('library').props.get('type'); #> |
|
1015 |
||
16 | 1016 |
<span class="setting"> |
1017 |
<input type="checkbox" id="playlist-settings-show-list" data-setting="tracklist" <# if ( emptyModel ) { #> |
|
5 | 1018 |
checked="checked" |
1019 |
<# } #> /> |
|
16 | 1020 |
<label for="playlist-settings-show-list" class="checkbox-label-inline"> |
1021 |
<# if ( isVideo ) { #> |
|
1022 |
<?php _e( 'Show Video List' ); ?> |
|
1023 |
<# } else { #> |
|
1024 |
<?php _e( 'Show Tracklist' ); ?> |
|
1025 |
<# } #> |
|
1026 |
</label> |
|
1027 |
</span> |
|
5 | 1028 |
|
1029 |
<# if ( ! isVideo ) { #> |
|
16 | 1030 |
<span class="setting"> |
1031 |
<input type="checkbox" id="playlist-settings-show-artist" data-setting="artists" <# if ( emptyModel ) { #> |
|
5 | 1032 |
checked="checked" |
1033 |
<# } #> /> |
|
16 | 1034 |
<label for="playlist-settings-show-artist" class="checkbox-label-inline"> |
1035 |
<?php _e( 'Show Artist Name in Tracklist' ); ?> |
|
1036 |
</label> |
|
1037 |
</span> |
|
5 | 1038 |
<# } #> |
1039 |
||
16 | 1040 |
<span class="setting"> |
1041 |
<input type="checkbox" id="playlist-settings-show-images" data-setting="images" <# if ( emptyModel ) { #> |
|
5 | 1042 |
checked="checked" |
1043 |
<# } #> /> |
|
16 | 1044 |
<label for="playlist-settings-show-images" class="checkbox-label-inline"> |
1045 |
<?php _e( 'Show Images' ); ?> |
|
1046 |
</label> |
|
1047 |
</span> |
|
0 | 1048 |
</script> |
1049 |
||
16 | 1050 |
<?php // Template for the "Insert from URL" layout. ?> |
0 | 1051 |
<script type="text/html" id="tmpl-embed-link-settings"> |
16 | 1052 |
<span class="setting link-text"> |
1053 |
<label for="embed-link-settings-link-text" class="name"><?php _e( 'Link Text' ); ?></label> |
|
1054 |
<input type="text" id="embed-link-settings-link-text" class="alignment" data-setting="linkText" /> |
|
1055 |
</span> |
|
5 | 1056 |
<div class="embed-container" style="display: none;"> |
1057 |
<div class="embed-preview"></div> |
|
1058 |
</div> |
|
0 | 1059 |
</script> |
1060 |
||
16 | 1061 |
<?php // Template for the "Insert from URL" image preview and details. ?> |
0 | 1062 |
<script type="text/html" id="tmpl-embed-image-settings"> |
16 | 1063 |
<div class="wp-clearfix"> |
1064 |
<div class="thumbnail"> |
|
1065 |
<img src="{{ data.model.url }}" draggable="false" alt="" /> |
|
1066 |
</div> |
|
0 | 1067 |
</div> |
1068 |
||
16 | 1069 |
<span class="setting alt-text has-description"> |
1070 |
<label for="embed-image-settings-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1071 |
<textarea id="embed-image-settings-alt-text" data-setting="alt" aria-describedby="alt-text-description"></textarea> |
16 | 1072 |
</span> |
9 | 1073 |
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p> |
1074 |
||
5 | 1075 |
<?php |
1076 |
/** This filter is documented in wp-admin/includes/media.php */ |
|
9 | 1077 |
if ( ! apply_filters( 'disable_captions', '' ) ) : |
1078 |
?> |
|
16 | 1079 |
<span class="setting caption"> |
1080 |
<label for="embed-image-settings-caption" class="name"><?php _e( 'Caption' ); ?></label> |
|
18 | 1081 |
<textarea id="embed-image-settings-caption" data-setting="caption"></textarea> |
16 | 1082 |
</span> |
0 | 1083 |
<?php endif; ?> |
1084 |
||
16 | 1085 |
<fieldset class="setting-group"> |
1086 |
<legend class="name"><?php _e( 'Align' ); ?></legend> |
|
1087 |
<span class="setting align"> |
|
1088 |
<span class="button-group button-large" data-setting="align"> |
|
1089 |
<button class="button" value="left"> |
|
1090 |
<?php esc_html_e( 'Left' ); ?> |
|
1091 |
</button> |
|
1092 |
<button class="button" value="center"> |
|
1093 |
<?php esc_html_e( 'Center' ); ?> |
|
1094 |
</button> |
|
1095 |
<button class="button" value="right"> |
|
1096 |
<?php esc_html_e( 'Right' ); ?> |
|
1097 |
</button> |
|
1098 |
<button class="button active" value="none"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1099 |
<?php echo esc_html_x( 'None', 'Alignment option' ); ?> |
16 | 1100 |
</button> |
1101 |
</span> |
|
1102 |
</span> |
|
1103 |
</fieldset> |
|
0 | 1104 |
|
16 | 1105 |
<fieldset class="setting-group"> |
1106 |
<legend class="name"><?php _e( 'Link To' ); ?></legend> |
|
1107 |
<span class="setting link-to"> |
|
1108 |
<span class="button-group button-large" data-setting="link"> |
|
1109 |
<button class="button" value="file"> |
|
1110 |
<?php esc_html_e( 'Image URL' ); ?> |
|
1111 |
</button> |
|
1112 |
<button class="button" value="custom"> |
|
1113 |
<?php esc_html_e( 'Custom URL' ); ?> |
|
1114 |
</button> |
|
1115 |
<button class="button active" value="none"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1116 |
<?php echo esc_html_x( 'None', 'Media item link option' ); ?> |
16 | 1117 |
</button> |
1118 |
</span> |
|
1119 |
</span> |
|
1120 |
<span class="setting"> |
|
1121 |
<label for="embed-image-settings-link-to-custom" class="name"><?php _e( 'URL' ); ?></label> |
|
1122 |
<input type="text" id="embed-image-settings-link-to-custom" class="link-to-custom" data-setting="linkUrl" /> |
|
1123 |
</span> |
|
1124 |
</fieldset> |
|
0 | 1125 |
</script> |
1126 |
||
16 | 1127 |
<?php // Template for the Image details, used for example in the editor. ?> |
5 | 1128 |
<script type="text/html" id="tmpl-image-details"> |
1129 |
<div class="media-embed"> |
|
1130 |
<div class="embed-media-settings"> |
|
1131 |
<div class="column-settings"> |
|
16 | 1132 |
<span class="setting alt-text has-description"> |
1133 |
<label for="image-details-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1134 |
<textarea id="image-details-alt-text" data-setting="alt" aria-describedby="alt-text-description">{{ data.model.alt }}</textarea> |
16 | 1135 |
</span> |
9 | 1136 |
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p> |
1137 |
||
5 | 1138 |
<?php |
1139 |
/** This filter is documented in wp-admin/includes/media.php */ |
|
9 | 1140 |
if ( ! apply_filters( 'disable_captions', '' ) ) : |
1141 |
?> |
|
16 | 1142 |
<span class="setting caption"> |
1143 |
<label for="image-details-caption" class="name"><?php _e( 'Caption' ); ?></label> |
|
1144 |
<textarea id="image-details-caption" data-setting="caption">{{ data.model.caption }}</textarea> |
|
1145 |
</span> |
|
5 | 1146 |
<?php endif; ?> |
1147 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1148 |
<h2><?php _e( 'Display Settings' ); ?></h2> |
16 | 1149 |
<fieldset class="setting-group"> |
1150 |
<legend class="legend-inline"><?php _e( 'Align' ); ?></legend> |
|
1151 |
<span class="setting align"> |
|
1152 |
<span class="button-group button-large" data-setting="align"> |
|
1153 |
<button class="button" value="left"> |
|
1154 |
<?php esc_html_e( 'Left' ); ?> |
|
1155 |
</button> |
|
1156 |
<button class="button" value="center"> |
|
1157 |
<?php esc_html_e( 'Center' ); ?> |
|
1158 |
</button> |
|
1159 |
<button class="button" value="right"> |
|
1160 |
<?php esc_html_e( 'Right' ); ?> |
|
1161 |
</button> |
|
1162 |
<button class="button active" value="none"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1163 |
<?php echo esc_html_x( 'None', 'Alignment option' ); ?> |
16 | 1164 |
</button> |
1165 |
</span> |
|
1166 |
</span> |
|
1167 |
</fieldset> |
|
5 | 1168 |
|
1169 |
<# if ( data.attachment ) { #> |
|
1170 |
<# if ( 'undefined' !== typeof data.attachment.sizes ) { #> |
|
16 | 1171 |
<span class="setting size"> |
1172 |
<label for="image-details-size" class="name"><?php _e( 'Size' ); ?></label> |
|
1173 |
<select id="image-details-size" class="size" name="size" |
|
5 | 1174 |
data-setting="size" |
1175 |
<# if ( data.userSettings ) { #> |
|
1176 |
data-user-setting="imgsize" |
|
1177 |
<# } #>> |
|
1178 |
<?php |
|
1179 |
/** This filter is documented in wp-admin/includes/media.php */ |
|
9 | 1180 |
$sizes = apply_filters( |
1181 |
'image_size_names_choose', |
|
1182 |
array( |
|
1183 |
'thumbnail' => __( 'Thumbnail' ), |
|
1184 |
'medium' => __( 'Medium' ), |
|
1185 |
'large' => __( 'Large' ), |
|
1186 |
'full' => __( 'Full Size' ), |
|
1187 |
) |
|
1188 |
); |
|
5 | 1189 |
|
9 | 1190 |
foreach ( $sizes as $value => $name ) : |
1191 |
?> |
|
5 | 1192 |
<# |
1193 |
var size = data.sizes['<?php echo esc_js( $value ); ?>']; |
|
1194 |
if ( size ) { #> |
|
1195 |
<option value="<?php echo esc_attr( $value ); ?>"> |
|
1196 |
<?php echo esc_html( $name ); ?> – {{ size.width }} × {{ size.height }} |
|
1197 |
</option> |
|
1198 |
<# } #> |
|
1199 |
<?php endforeach; ?> |
|
1200 |
<option value="<?php echo esc_attr( 'custom' ); ?>"> |
|
1201 |
<?php _e( 'Custom Size' ); ?> |
|
1202 |
</option> |
|
1203 |
</select> |
|
16 | 1204 |
</span> |
5 | 1205 |
<# } #> |
16 | 1206 |
<div class="custom-size wp-clearfix<# if ( data.model.size !== 'custom' ) { #> hidden<# } #>"> |
1207 |
<span class="custom-size-setting"> |
|
1208 |
<label for="image-details-size-width"><?php _e( 'Width' ); ?></label> |
|
1209 |
<input type="number" id="image-details-size-width" aria-describedby="image-size-desc" data-setting="customWidth" step="1" value="{{ data.model.customWidth }}" /> |
|
1210 |
</span> |
|
1211 |
<span class="sep" aria-hidden="true">×</span> |
|
1212 |
<span class="custom-size-setting"> |
|
1213 |
<label for="image-details-size-height"><?php _e( 'Height' ); ?></label> |
|
1214 |
<input type="number" id="image-details-size-height" aria-describedby="image-size-desc" data-setting="customHeight" step="1" value="{{ data.model.customHeight }}" /> |
|
1215 |
</span> |
|
1216 |
<p id="image-size-desc" class="description"><?php _e( 'Image size in pixels' ); ?></p> |
|
5 | 1217 |
</div> |
1218 |
<# } #> |
|
0 | 1219 |
|
16 | 1220 |
<span class="setting link-to"> |
1221 |
<label for="image-details-link-to" class="name"><?php _e( 'Link To' ); ?></label> |
|
1222 |
<select id="image-details-link-to" data-setting="link"> |
|
5 | 1223 |
<# if ( data.attachment ) { #> |
1224 |
<option value="file"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1225 |
<?php esc_html_e( 'Media File' ); ?> |
5 | 1226 |
</option> |
1227 |
<option value="post"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1228 |
<?php esc_html_e( 'Attachment Page' ); ?> |
5 | 1229 |
</option> |
1230 |
<# } else { #> |
|
1231 |
<option value="file"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1232 |
<?php esc_html_e( 'Image URL' ); ?> |
5 | 1233 |
</option> |
1234 |
<# } #> |
|
1235 |
<option value="custom"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1236 |
<?php esc_html_e( 'Custom URL' ); ?> |
5 | 1237 |
</option> |
1238 |
<option value="none"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1239 |
<?php echo esc_html_x( 'None', 'Media item link option' ); ?> |
5 | 1240 |
</option> |
1241 |
</select> |
|
16 | 1242 |
</span> |
1243 |
<span class="setting"> |
|
1244 |
<label for="image-details-link-to-custom" class="name"><?php _e( 'URL' ); ?></label> |
|
1245 |
<input type="text" id="image-details-link-to-custom" class="link-to-custom" data-setting="linkUrl" /> |
|
1246 |
</span> |
|
1247 |
||
5 | 1248 |
<div class="advanced-section"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1249 |
<h2><button type="button" class="button-link advanced-toggle"><?php _e( 'Advanced Options' ); ?></button></h2> |
5 | 1250 |
<div class="advanced-settings hidden"> |
1251 |
<div class="advanced-image"> |
|
16 | 1252 |
<span class="setting title-text"> |
1253 |
<label for="image-details-title-attribute" class="name"><?php _e( 'Image Title Attribute' ); ?></label> |
|
1254 |
<input type="text" id="image-details-title-attribute" data-setting="title" value="{{ data.model.title }}" /> |
|
1255 |
</span> |
|
1256 |
<span class="setting extra-classes"> |
|
1257 |
<label for="image-details-css-class" class="name"><?php _e( 'Image CSS Class' ); ?></label> |
|
1258 |
<input type="text" id="image-details-css-class" data-setting="extraClasses" value="{{ data.model.extraClasses }}" /> |
|
1259 |
</span> |
|
5 | 1260 |
</div> |
1261 |
<div class="advanced-link"> |
|
16 | 1262 |
<span class="setting link-target"> |
1263 |
<input type="checkbox" id="image-details-link-target" data-setting="linkTargetBlank" value="_blank" <# if ( data.model.linkTargetBlank ) { #>checked="checked"<# } #>> |
|
1264 |
<label for="image-details-link-target" class="checkbox-label"><?php _e( 'Open link in a new tab' ); ?></label> |
|
1265 |
</span> |
|
1266 |
<span class="setting link-rel"> |
|
1267 |
<label for="image-details-link-rel" class="name"><?php _e( 'Link Rel' ); ?></label> |
|
1268 |
<input type="text" id="image-details-link-rel" data-setting="linkRel" value="{{ data.model.linkRel }}" /> |
|
1269 |
</span> |
|
1270 |
<span class="setting link-class-name"> |
|
1271 |
<label for="image-details-link-css-class" class="name"><?php _e( 'Link CSS Class' ); ?></label> |
|
1272 |
<input type="text" id="image-details-link-css-class" data-setting="linkClassName" value="{{ data.model.linkClassName }}" /> |
|
1273 |
</span> |
|
5 | 1274 |
</div> |
1275 |
</div> |
|
1276 |
</div> |
|
1277 |
</div> |
|
16 | 1278 |
<div class="column-image"> |
1279 |
<div class="image"> |
|
1280 |
<img src="{{ data.model.url }}" draggable="false" alt="" /> |
|
1281 |
<# if ( data.attachment && window.imageEdit ) { #> |
|
1282 |
<div class="actions"> |
|
1283 |
<input type="button" class="edit-attachment button" value="<?php esc_attr_e( 'Edit Original' ); ?>" /> |
|
1284 |
<input type="button" class="replace-attachment button" value="<?php esc_attr_e( 'Replace' ); ?>" /> |
|
1285 |
</div> |
|
1286 |
<# } #> |
|
1287 |
</div> |
|
1288 |
</div> |
|
5 | 1289 |
</div> |
1290 |
</div> |
|
1291 |
</script> |
|
1292 |
||
16 | 1293 |
<?php // Template for the Image Editor layout. ?> |
5 | 1294 |
<script type="text/html" id="tmpl-image-editor"> |
1295 |
<div id="media-head-{{ data.id }}"></div> |
|
1296 |
<div id="image-editor-{{ data.id }}"></div> |
|
1297 |
</script> |
|
1298 |
||
16 | 1299 |
<?php // Template for an embedded Audio details. ?> |
5 | 1300 |
<script type="text/html" id="tmpl-audio-details"> |
1301 |
<# var ext, html5types = { |
|
1302 |
mp3: wp.media.view.settings.embedMimes.mp3, |
|
1303 |
ogg: wp.media.view.settings.embedMimes.ogg |
|
1304 |
}; #> |
|
1305 |
||
1306 |
<?php $audio_types = wp_get_audio_extensions(); ?> |
|
1307 |
<div class="media-embed media-embed-details"> |
|
1308 |
<div class="embed-media-settings embed-audio-settings"> |
|
9 | 1309 |
<?php wp_underscore_audio_template(); ?> |
5 | 1310 |
|
1311 |
<# if ( ! _.isEmpty( data.model.src ) ) { |
|
1312 |
ext = data.model.src.split('.').pop(); |
|
1313 |
if ( html5types[ ext ] ) { |
|
1314 |
delete html5types[ ext ]; |
|
1315 |
} |
|
1316 |
#> |
|
16 | 1317 |
<span class="setting"> |
1318 |
<label for="audio-details-source" class="name"><?php _e( 'URL' ); ?></label> |
|
1319 |
<input type="text" id="audio-details-source" readonly data-setting="src" value="{{ data.model.src }}" /> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1320 |
<button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button> |
16 | 1321 |
</span> |
5 | 1322 |
<# } #> |
1323 |
<?php |
|
0 | 1324 |
|
9 | 1325 |
foreach ( $audio_types as $type ) : |
1326 |
?> |
|
1327 |
<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) { |
|
1328 |
if ( ! _.isUndefined( html5types.<?php echo $type; ?> ) ) { |
|
1329 |
delete html5types.<?php echo $type; ?>; |
|
5 | 1330 |
} |
1331 |
#> |
|
16 | 1332 |
<span class="setting"> |
1333 |
<label for="audio-details-<?php echo $type . '-source'; ?>" class="name"><?php echo strtoupper( $type ); ?></label> |
|
1334 |
<input type="text" id="audio-details-<?php echo $type . '-source'; ?>" readonly data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" /> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1335 |
<button type="button" class="button-link remove-setting"><?php _e( 'Remove audio source' ); ?></button> |
16 | 1336 |
</span> |
5 | 1337 |
<# } #> |
19 | 1338 |
<?php endforeach; ?> |
5 | 1339 |
|
1340 |
<# if ( ! _.isEmpty( html5types ) ) { #> |
|
16 | 1341 |
<fieldset class="setting-group"> |
1342 |
<legend class="name"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend> |
|
1343 |
<span class="setting"> |
|
1344 |
<span class="button-large"> |
|
1345 |
<# _.each( html5types, function (mime, type) { #> |
|
1346 |
<button class="button add-media-source" data-mime="{{ mime }}">{{ type }}</button> |
|
1347 |
<# } ) #> |
|
1348 |
</span> |
|
1349 |
</span> |
|
1350 |
</fieldset> |
|
5 | 1351 |
<# } #> |
1352 |
||
16 | 1353 |
<fieldset class="setting-group"> |
1354 |
<legend class="name"><?php _e( 'Preload' ); ?></legend> |
|
1355 |
<span class="setting preload"> |
|
1356 |
<span class="button-group button-large" data-setting="preload"> |
|
1357 |
<button class="button" value="auto"><?php _ex( 'Auto', 'auto preload' ); ?></button> |
|
1358 |
<button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1359 |
<button class="button active" value="none"><?php _ex( 'None', 'Preload value' ); ?></button> |
16 | 1360 |
</span> |
1361 |
</span> |
|
1362 |
</fieldset> |
|
5 | 1363 |
|
16 | 1364 |
<span class="setting-group"> |
1365 |
<span class="setting checkbox-setting autoplay"> |
|
1366 |
<input type="checkbox" id="audio-details-autoplay" data-setting="autoplay" /> |
|
1367 |
<label for="audio-details-autoplay" class="checkbox-label"><?php _e( 'Autoplay' ); ?></label> |
|
1368 |
</span> |
|
5 | 1369 |
|
16 | 1370 |
<span class="setting checkbox-setting"> |
1371 |
<input type="checkbox" id="audio-details-loop" data-setting="loop" /> |
|
1372 |
<label for="audio-details-loop" class="checkbox-label"><?php _e( 'Loop' ); ?></label> |
|
1373 |
</span> |
|
1374 |
</span> |
|
5 | 1375 |
</div> |
1376 |
</div> |
|
1377 |
</script> |
|
1378 |
||
16 | 1379 |
<?php // Template for an embedded Video details. ?> |
5 | 1380 |
<script type="text/html" id="tmpl-video-details"> |
1381 |
<# var ext, html5types = { |
|
1382 |
mp4: wp.media.view.settings.embedMimes.mp4, |
|
1383 |
ogv: wp.media.view.settings.embedMimes.ogv, |
|
1384 |
webm: wp.media.view.settings.embedMimes.webm |
|
1385 |
}; #> |
|
1386 |
||
1387 |
<?php $video_types = wp_get_video_extensions(); ?> |
|
1388 |
<div class="media-embed media-embed-details"> |
|
1389 |
<div class="embed-media-settings embed-video-settings"> |
|
1390 |
<div class="wp-video-holder"> |
|
1391 |
<# |
|
1392 |
var w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width, |
|
1393 |
h = ! data.model.height ? 360 : data.model.height; |
|
1394 |
||
1395 |
if ( data.model.width && w !== data.model.width ) { |
|
1396 |
h = Math.ceil( ( h * w ) / data.model.width ); |
|
1397 |
} |
|
1398 |
#> |
|
1399 |
||
9 | 1400 |
<?php wp_underscore_video_template(); ?> |
0 | 1401 |
|
5 | 1402 |
<# if ( ! _.isEmpty( data.model.src ) ) { |
1403 |
ext = data.model.src.split('.').pop(); |
|
1404 |
if ( html5types[ ext ] ) { |
|
1405 |
delete html5types[ ext ]; |
|
1406 |
} |
|
1407 |
#> |
|
16 | 1408 |
<span class="setting"> |
1409 |
<label for="video-details-source" class="name"><?php _e( 'URL' ); ?></label> |
|
1410 |
<input type="text" id="video-details-source" readonly data-setting="src" value="{{ data.model.src }}" /> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1411 |
<button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button> |
16 | 1412 |
</span> |
5 | 1413 |
<# } #> |
9 | 1414 |
<?php |
1415 |
foreach ( $video_types as $type ) : |
|
1416 |
?> |
|
1417 |
<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) { |
|
1418 |
if ( ! _.isUndefined( html5types.<?php echo $type; ?> ) ) { |
|
1419 |
delete html5types.<?php echo $type; ?>; |
|
5 | 1420 |
} |
1421 |
#> |
|
16 | 1422 |
<span class="setting"> |
1423 |
<label for="video-details-<?php echo $type . '-source'; ?>" class="name"><?php echo strtoupper( $type ); ?></label> |
|
1424 |
<input type="text" id="video-details-<?php echo $type . '-source'; ?>" readonly data-setting="<?php echo $type; ?>" value="{{ data.model.<?php echo $type; ?> }}" /> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1425 |
<button type="button" class="button-link remove-setting"><?php _e( 'Remove video source' ); ?></button> |
16 | 1426 |
</span> |
5 | 1427 |
<# } #> |
19 | 1428 |
<?php endforeach; ?> |
5 | 1429 |
</div> |
1430 |
||
1431 |
<# if ( ! _.isEmpty( html5types ) ) { #> |
|
16 | 1432 |
<fieldset class="setting-group"> |
1433 |
<legend class="name"><?php _e( 'Add alternate sources for maximum HTML5 playback' ); ?></legend> |
|
1434 |
<span class="setting"> |
|
1435 |
<span class="button-large"> |
|
1436 |
<# _.each( html5types, function (mime, type) { #> |
|
1437 |
<button class="button add-media-source" data-mime="{{ mime }}">{{ type }}</button> |
|
1438 |
<# } ) #> |
|
1439 |
</span> |
|
1440 |
</span> |
|
1441 |
</fieldset> |
|
5 | 1442 |
<# } #> |
1443 |
||
1444 |
<# if ( ! _.isEmpty( data.model.poster ) ) { #> |
|
16 | 1445 |
<span class="setting"> |
1446 |
<label for="video-details-poster-image" class="name"><?php _e( 'Poster Image' ); ?></label> |
|
1447 |
<input type="text" id="video-details-poster-image" readonly data-setting="poster" value="{{ data.model.poster }}" /> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1448 |
<button type="button" class="button-link remove-setting"><?php _e( 'Remove poster image' ); ?></button> |
16 | 1449 |
</span> |
5 | 1450 |
<# } #> |
16 | 1451 |
|
1452 |
<fieldset class="setting-group"> |
|
1453 |
<legend class="name"><?php _e( 'Preload' ); ?></legend> |
|
1454 |
<span class="setting preload"> |
|
1455 |
<span class="button-group button-large" data-setting="preload"> |
|
1456 |
<button class="button" value="auto"><?php _ex( 'Auto', 'auto preload' ); ?></button> |
|
1457 |
<button class="button" value="metadata"><?php _e( 'Metadata' ); ?></button> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1458 |
<button class="button active" value="none"><?php _ex( 'None', 'Preload value' ); ?></button> |
16 | 1459 |
</span> |
1460 |
</span> |
|
1461 |
</fieldset> |
|
5 | 1462 |
|
16 | 1463 |
<span class="setting-group"> |
1464 |
<span class="setting checkbox-setting autoplay"> |
|
1465 |
<input type="checkbox" id="video-details-autoplay" data-setting="autoplay" /> |
|
1466 |
<label for="video-details-autoplay" class="checkbox-label"><?php _e( 'Autoplay' ); ?></label> |
|
1467 |
</span> |
|
0 | 1468 |
|
16 | 1469 |
<span class="setting checkbox-setting"> |
1470 |
<input type="checkbox" id="video-details-loop" data-setting="loop" /> |
|
1471 |
<label for="video-details-loop" class="checkbox-label"><?php _e( 'Loop' ); ?></label> |
|
1472 |
</span> |
|
1473 |
</span> |
|
5 | 1474 |
|
16 | 1475 |
<span class="setting" data-setting="content"> |
5 | 1476 |
<# |
1477 |
var content = ''; |
|
1478 |
if ( ! _.isEmpty( data.model.content ) ) { |
|
1479 |
var tracks = jQuery( data.model.content ).filter( 'track' ); |
|
16 | 1480 |
_.each( tracks.toArray(), function( track, index ) { |
5 | 1481 |
content += track.outerHTML; #> |
16 | 1482 |
<label for="video-details-track-{{ index }}" class="name"><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></label> |
1483 |
<input class="content-track" type="text" id="video-details-track-{{ index }}" aria-describedby="video-details-track-desc-{{ index }}" value="{{ track.outerHTML }}" /> |
|
1484 |
<span class="description" id="video-details-track-desc-{{ index }}"> |
|
1485 |
<?php |
|
1486 |
printf( |
|
1487 |
/* translators: 1: "srclang" HTML attribute, 2: "label" HTML attribute, 3: "kind" HTML attribute. */ |
|
1488 |
__( 'The %1$s, %2$s, and %3$s values can be edited to set the video track language and kind.' ), |
|
1489 |
'srclang', |
|
1490 |
'label', |
|
1491 |
'kind' |
|
1492 |
); |
|
1493 |
?> |
|
1494 |
</span> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1495 |
<button type="button" class="button-link remove-setting remove-track"><?php _ex( 'Remove video track', 'media' ); ?></button><br /> |
5 | 1496 |
<# } ); #> |
1497 |
<# } else { #> |
|
16 | 1498 |
<span class="name"><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></span><br /> |
5 | 1499 |
<em><?php _e( 'There are no associated subtitles.' ); ?></em> |
1500 |
<# } #> |
|
1501 |
<textarea class="hidden content-setting">{{ content }}</textarea> |
|
16 | 1502 |
</span> |
5 | 1503 |
</div> |
1504 |
</div> |
|
0 | 1505 |
</script> |
5 | 1506 |
|
16 | 1507 |
<?php // Template for a Gallery within the editor. ?> |
5 | 1508 |
<script type="text/html" id="tmpl-editor-gallery"> |
1509 |
<# if ( data.attachments.length ) { #> |
|
1510 |
<div class="gallery gallery-columns-{{ data.columns }}"> |
|
1511 |
<# _.each( data.attachments, function( attachment, index ) { #> |
|
1512 |
<dl class="gallery-item"> |
|
1513 |
<dt class="gallery-icon"> |
|
1514 |
<# if ( attachment.thumbnail ) { #> |
|
9 | 1515 |
<img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" alt="{{ attachment.alt }}" /> |
5 | 1516 |
<# } else { #> |
9 | 1517 |
<img src="{{ attachment.url }}" alt="{{ attachment.alt }}" /> |
5 | 1518 |
<# } #> |
1519 |
</dt> |
|
1520 |
<# if ( attachment.caption ) { #> |
|
1521 |
<dd class="wp-caption-text gallery-caption"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1522 |
{{{ data.verifyHTML( attachment.caption ) }}} |
5 | 1523 |
</dd> |
1524 |
<# } #> |
|
1525 |
</dl> |
|
1526 |
<# if ( index % data.columns === data.columns - 1 ) { #> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1527 |
<br style="clear: both;" /> |
5 | 1528 |
<# } #> |
1529 |
<# } ); #> |
|
1530 |
</div> |
|
1531 |
<# } else { #> |
|
1532 |
<div class="wpview-error"> |
|
1533 |
<div class="dashicons dashicons-format-gallery"></div><p><?php _e( 'No items found.' ); ?></p> |
|
1534 |
</div> |
|
1535 |
<# } #> |
|
1536 |
</script> |
|
1537 |
||
16 | 1538 |
<?php // Template for the Crop area layout, used for example in the Customizer. ?> |
5 | 1539 |
<script type="text/html" id="tmpl-crop-content"> |
19 | 1540 |
<img class="crop-image" src="{{ data.url }}" alt="<?php esc_attr_e( 'Image crop area preview. Requires mouse interaction.' ); ?>" /> |
5 | 1541 |
<div class="upload-errors"></div> |
1542 |
</script> |
|
1543 |
||
16 | 1544 |
<?php // Template for the Site Icon preview, used for example in the Customizer. ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1545 |
<script type="text/html" id="tmpl-site-icon-preview"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1546 |
<h2><?php _e( 'Preview' ); ?></h2> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1547 |
<strong aria-hidden="true"><?php _e( 'As a browser icon' ); ?></strong> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1548 |
<div class="favicon-preview"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1549 |
<img src="<?php echo esc_url( admin_url( 'images/' . ( is_rtl() ? 'browser-rtl.png' : 'browser.png' ) ) ); ?>" class="browser-preview" width="182" height="" alt="" /> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1550 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1551 |
<div class="favicon"> |
18 | 1552 |
<img id="preview-favicon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as a browser icon' ); ?>" /> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1553 |
</div> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1554 |
<span class="browser-title" aria-hidden="true"><# print( '<?php echo esc_js( get_bloginfo( 'name' ) ); ?>' ) #></span> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1555 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1556 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1557 |
<strong aria-hidden="true"><?php _e( 'As an app icon' ); ?></strong> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1558 |
<div class="app-icon-preview"> |
18 | 1559 |
<img id="preview-app-icon" src="{{ data.url }}" alt="<?php esc_attr_e( 'Preview as an app icon' ); ?>" /> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1560 |
</div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1561 |
</script> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1562 |
|
0 | 1563 |
<?php |
1564 |
||
5 | 1565 |
/** |
1566 |
* Fires when the custom Backbone media templates are printed. |
|
1567 |
* |
|
1568 |
* @since 3.5.0 |
|
1569 |
*/ |
|
0 | 1570 |
do_action( 'print_media_templates' ); |
1571 |
} |