Edit File by line
/home/barbar84/public_h.../wp-inclu...
File: media-template.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress media templates.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Media
[5] Fix | Delete
* @since 3.5.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Output the markup for a audio tag to be used in an Underscore template
[10] Fix | Delete
* when data.model is passed.
[11] Fix | Delete
*
[12] Fix | Delete
* @since 3.9.0
[13] Fix | Delete
*/
[14] Fix | Delete
function wp_underscore_audio_template() {
[15] Fix | Delete
$audio_types = wp_get_audio_extensions();
[16] Fix | Delete
?>
[17] Fix | Delete
<audio style="visibility: hidden"
[18] Fix | Delete
controls
[19] Fix | Delete
class="wp-audio-shortcode"
[20] Fix | Delete
width="{{ _.isUndefined( data.model.width ) ? 400 : data.model.width }}"
[21] Fix | Delete
preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}"
[22] Fix | Delete
<#
[23] Fix | Delete
<?php
[24] Fix | Delete
foreach ( array( 'autoplay', 'loop' ) as $attr ) :
[25] Fix | Delete
?>
[26] Fix | Delete
if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
[27] Fix | Delete
#> <?php echo $attr; ?><#
[28] Fix | Delete
}
[29] Fix | Delete
<?php endforeach ?>#>
[30] Fix | Delete
>
[31] Fix | Delete
<# if ( ! _.isEmpty( data.model.src ) ) { #>
[32] Fix | Delete
<source src="{{ data.model.src }}" type="{{ wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}" />
[33] Fix | Delete
<# } #>
[34] Fix | Delete
[35] Fix | Delete
<?php
[36] Fix | Delete
foreach ( $audio_types as $type ) :
[37] Fix | Delete
?>
[38] Fix | Delete
<# if ( ! _.isEmpty( data.model.<?php echo $type; ?> ) ) { #>
[39] Fix | Delete
<source src="{{ data.model.<?php echo $type; ?> }}" type="{{ wp.media.view.settings.embedMimes[ '<?php echo $type; ?>' ] }}" />
[40] Fix | Delete
<# } #>
[41] Fix | Delete
<?php
[42] Fix | Delete
endforeach;
[43] Fix | Delete
?>
[44] Fix | Delete
</audio>
[45] Fix | Delete
<?php
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
/**
[49] Fix | Delete
* Output the markup for a video tag to be used in an Underscore template
[50] Fix | Delete
* when data.model is passed.
[51] Fix | Delete
*
[52] Fix | Delete
* @since 3.9.0
[53] Fix | Delete
*/
[54] Fix | Delete
function wp_underscore_video_template() {
[55] Fix | Delete
$video_types = wp_get_video_extensions();
[56] Fix | Delete
?>
[57] Fix | Delete
<# var w_rule = '', classes = [],
[58] Fix | Delete
w, h, settings = wp.media.view.settings,
[59] Fix | Delete
isYouTube = isVimeo = false;
[60] Fix | Delete
[61] Fix | Delete
if ( ! _.isEmpty( data.model.src ) ) {
[62] Fix | Delete
isYouTube = data.model.src.match(/youtube|youtu\.be/);
[63] Fix | Delete
isVimeo = -1 !== data.model.src.indexOf('vimeo');
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
if ( settings.contentWidth && data.model.width >= settings.contentWidth ) {
[67] Fix | Delete
w = settings.contentWidth;
[68] Fix | Delete
} else {
[69] Fix | Delete
w = data.model.width;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
if ( w !== data.model.width ) {
[73] Fix | Delete
h = Math.ceil( ( data.model.height * w ) / data.model.width );
[74] Fix | Delete
} else {
[75] Fix | Delete
h = data.model.height;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
if ( w ) {
[79] Fix | Delete
w_rule = 'width: ' + w + 'px; ';
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
if ( isYouTube ) {
[83] Fix | Delete
classes.push( 'youtube-video' );
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
if ( isVimeo ) {
[87] Fix | Delete
classes.push( 'vimeo-video' );
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
#>
[91] Fix | Delete
<div style="{{ w_rule }}" class="wp-video">
[92] Fix | Delete
<video controls
[93] Fix | Delete
class="wp-video-shortcode {{ classes.join( ' ' ) }}"
[94] Fix | Delete
<# if ( w ) { #>width="{{ w }}"<# } #>
[95] Fix | Delete
<# if ( h ) { #>height="{{ h }}"<# } #>
[96] Fix | Delete
<?php
[97] Fix | Delete
$props = array(
[98] Fix | Delete
'poster' => '',
[99] Fix | Delete
'preload' => 'metadata',
[100] Fix | Delete
);
[101] Fix | Delete
foreach ( $props as $key => $value ) :
[102] Fix | Delete
if ( empty( $value ) ) {
[103] Fix | Delete
?>
[104] Fix | Delete
<#
[105] Fix | Delete
if ( ! _.isUndefined( data.model.<?php echo $key; ?> ) && data.model.<?php echo $key; ?> ) {
[106] Fix | Delete
#> <?php echo $key; ?>="{{ data.model.<?php echo $key; ?> }}"<#
[107] Fix | Delete
} #>
[108] Fix | Delete
<?php
[109] Fix | Delete
} else {
[110] Fix | Delete
echo $key
[111] Fix | Delete
?>
[112] Fix | Delete
="{{ _.isUndefined( data.model.<?php echo $key; ?> ) ? '<?php echo $value; ?>' : data.model.<?php echo $key; ?> }}"
[113] Fix | Delete
<?php
[114] Fix | Delete
}
[115] Fix | Delete
endforeach;
[116] Fix | Delete
?>
[117] Fix | Delete
<#
[118] Fix | Delete
<?php
[119] Fix | Delete
foreach ( array( 'autoplay', 'loop' ) as $attr ) :
[120] Fix | Delete
?>
[121] Fix | Delete
if ( ! _.isUndefined( data.model.<?php echo $attr; ?> ) && data.model.<?php echo $attr; ?> ) {
[122] Fix | Delete
#> <?php echo $attr; ?><#
[123] Fix | Delete
}
[124] Fix | Delete
<?php endforeach ?>#>
[125] Fix | Delete
>
[126] Fix | Delete
<# if ( ! _.isEmpty( data.model.src ) ) {
[127] Fix | Delete
if ( isYouTube ) { #>
[128] Fix | Delete
<source src="{{ data.model.src }}" type="video/youtube" />
[129] Fix | Delete
<# } else if ( isVimeo ) { #>
[130] Fix | Delete
<source src="{{ data.model.src }}" type="video/vimeo" />
[131] Fix | Delete
<# } else { #>
[132] Fix | Delete
<source src="{{ data.model.src }}" type="{{ settings.embedMimes[ data.model.src.split('.').pop() ] }}" />
[133] Fix | Delete
<# }
[134] Fix | Delete
} #>
[135] Fix | Delete
[136] Fix | Delete
<?php
[137] Fix | Delete
foreach ( $video_types as $type ) :
[138] Fix | Delete
?>
[139] Fix | Delete
<# if ( data.model.<?php echo $type; ?> ) { #>
[140] Fix | Delete
<source src="{{ data.model.<?php echo $type; ?> }}" type="{{ settings.embedMimes[ '<?php echo $type; ?>' ] }}" />
[141] Fix | Delete
<# } #>
[142] Fix | Delete
<?php endforeach; ?>
[143] Fix | Delete
{{{ data.model.content }}}
[144] Fix | Delete
</video>
[145] Fix | Delete
</div>
[146] Fix | Delete
<?php
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* Prints the templates used in the media manager.
[151] Fix | Delete
*
[152] Fix | Delete
* @since 3.5.0
[153] Fix | Delete
*/
[154] Fix | Delete
function wp_print_media_templates() {
[155] Fix | Delete
$class = 'media-modal wp-core-ui';
[156] Fix | Delete
[157] Fix | Delete
$alt_text_description = sprintf(
[158] Fix | Delete
/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */
[159] Fix | Delete
__( '<a href="%1$s" %2$s>Describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
[160] Fix | Delete
esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ),
[161] Fix | Delete
'target="_blank" rel="noopener"',
[162] Fix | Delete
sprintf(
[163] Fix | Delete
'<span class="screen-reader-text"> %s</span>',
[164] Fix | Delete
/* translators: Accessibility text. */
[165] Fix | Delete
__( '(opens in a new tab)' )
[166] Fix | Delete
)
[167] Fix | Delete
);
[168] Fix | Delete
?>
[169] Fix | Delete
[170] Fix | Delete
<?php // Template for the media frame: used both in the media grid and in the media modal. ?>
[171] Fix | Delete
<script type="text/html" id="tmpl-media-frame">
[172] Fix | Delete
<div class="media-frame-title" id="media-frame-title"></div>
[173] Fix | Delete
<h2 class="media-frame-menu-heading"><?php _ex( 'Actions', 'media modal menu actions' ); ?></h2>
[174] Fix | Delete
<button type="button" class="button button-link media-frame-menu-toggle" aria-expanded="false">
[175] Fix | Delete
<?php _ex( 'Menu', 'media modal menu' ); ?>
[176] Fix | Delete
<span class="dashicons dashicons-arrow-down" aria-hidden="true"></span>
[177] Fix | Delete
</button>
[178] Fix | Delete
<div class="media-frame-menu"></div>
[179] Fix | Delete
<div class="media-frame-tab-panel">
[180] Fix | Delete
<div class="media-frame-router"></div>
[181] Fix | Delete
<div class="media-frame-content"></div>
[182] Fix | Delete
</div>
[183] Fix | Delete
<h2 class="media-frame-actions-heading screen-reader-text">
[184] Fix | Delete
<?php
[185] Fix | Delete
/* translators: Accessibility text. */
[186] Fix | Delete
_e( 'Selected media actions' );
[187] Fix | Delete
?>
[188] Fix | Delete
</h2>
[189] Fix | Delete
<div class="media-frame-toolbar"></div>
[190] Fix | Delete
<div class="media-frame-uploader"></div>
[191] Fix | Delete
</script>
[192] Fix | Delete
[193] Fix | Delete
<?php // Template for the media modal. ?>
[194] Fix | Delete
<script type="text/html" id="tmpl-media-modal">
[195] Fix | Delete
<div tabindex="0" class="<?php echo $class; ?>" role="dialog" aria-labelledby="media-frame-title">
[196] Fix | Delete
<# if ( data.hasCloseButton ) { #>
[197] Fix | Delete
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button>
[198] Fix | Delete
<# } #>
[199] Fix | Delete
<div class="media-modal-content" role="document"></div>
[200] Fix | Delete
</div>
[201] Fix | Delete
<div class="media-modal-backdrop"></div>
[202] Fix | Delete
</script>
[203] Fix | Delete
[204] Fix | Delete
<?php // Template for the window uploader, used for example in the media grid. ?>
[205] Fix | Delete
<script type="text/html" id="tmpl-uploader-window">
[206] Fix | Delete
<div class="uploader-window-content">
[207] Fix | Delete
<div class="uploader-editor-title"><?php _e( 'Drop files to upload' ); ?></div>
[208] Fix | Delete
</div>
[209] Fix | Delete
</script>
[210] Fix | Delete
[211] Fix | Delete
<?php // Template for the editor uploader. ?>
[212] Fix | Delete
<script type="text/html" id="tmpl-uploader-editor">
[213] Fix | Delete
<div class="uploader-editor-content">
[214] Fix | Delete
<div class="uploader-editor-title"><?php _e( 'Drop files to upload' ); ?></div>
[215] Fix | Delete
</div>
[216] Fix | Delete
</script>
[217] Fix | Delete
[218] Fix | Delete
<?php // Template for the inline uploader, used for example in the Media Library admin page - Add New. ?>
[219] Fix | Delete
<script type="text/html" id="tmpl-uploader-inline">
[220] Fix | Delete
<# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #>
[221] Fix | Delete
<# if ( data.canClose ) { #>
[222] Fix | Delete
<button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close uploader' ); ?></span></button>
[223] Fix | Delete
<# } #>
[224] Fix | Delete
<div class="uploader-inline-content {{ messageClass }}">
[225] Fix | Delete
<# if ( data.message ) { #>
[226] Fix | Delete
<h2 class="upload-message">{{ data.message }}</h2>
[227] Fix | Delete
<# } #>
[228] Fix | Delete
<?php if ( ! _device_can_upload() ) : ?>
[229] Fix | Delete
<div class="upload-ui">
[230] Fix | Delete
<h2 class="upload-instructions"><?php _e( 'Your browser cannot upload files' ); ?></h2>
[231] Fix | Delete
<p>
[232] Fix | Delete
<?php
[233] Fix | Delete
printf(
[234] Fix | Delete
/* translators: %s: https://apps.wordpress.org/ */
[235] Fix | Delete
__( '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.' ),
[236] Fix | Delete
'https://apps.wordpress.org/'
[237] Fix | Delete
);
[238] Fix | Delete
?>
[239] Fix | Delete
</p>
[240] Fix | Delete
</div>
[241] Fix | Delete
<?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?>
[242] Fix | Delete
<div class="upload-ui">
[243] Fix | Delete
<h2 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h2>
[244] Fix | Delete
<?php
[245] Fix | Delete
/** This action is documented in wp-admin/includes/media.php */
[246] Fix | Delete
do_action( 'upload_ui_over_quota' );
[247] Fix | Delete
?>
[248] Fix | Delete
</div>
[249] Fix | Delete
<?php else : ?>
[250] Fix | Delete
<div class="upload-ui">
[251] Fix | Delete
<h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files to upload' ); ?></h2>
[252] Fix | Delete
<p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>
[253] Fix | Delete
<button type="button" class="browser button button-hero" aria-labelledby="post-upload-info"><?php _e( 'Select Files' ); ?></button>
[254] Fix | Delete
</div>
[255] Fix | Delete
[256] Fix | Delete
<div class="upload-inline-status"></div>
[257] Fix | Delete
[258] Fix | Delete
<div class="post-upload-ui" id="post-upload-info">
[259] Fix | Delete
<?php
[260] Fix | Delete
/** This action is documented in wp-admin/includes/media.php */
[261] Fix | Delete
do_action( 'pre-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[262] Fix | Delete
/** This action is documented in wp-admin/includes/media.php */
[263] Fix | Delete
do_action( 'pre-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[264] Fix | Delete
[265] Fix | Delete
if ( 10 === remove_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' ) ) {
[266] Fix | Delete
/** This action is documented in wp-admin/includes/media.php */
[267] Fix | Delete
do_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[268] Fix | Delete
add_action( 'post-plupload-upload-ui', 'media_upload_flash_bypass' );
[269] Fix | Delete
} else {
[270] Fix | Delete
/** This action is documented in wp-admin/includes/media.php */
[271] Fix | Delete
do_action( 'post-plupload-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
$max_upload_size = wp_max_upload_size();
[275] Fix | Delete
if ( ! $max_upload_size ) {
[276] Fix | Delete
$max_upload_size = 0;
[277] Fix | Delete
}
[278] Fix | Delete
?>
[279] Fix | Delete
[280] Fix | Delete
<p class="max-upload-size">
[281] Fix | Delete
<?php
[282] Fix | Delete
printf(
[283] Fix | Delete
/* translators: %s: Maximum allowed file size. */
[284] Fix | Delete
__( 'Maximum upload file size: %s.' ),
[285] Fix | Delete
esc_html( size_format( $max_upload_size ) )
[286] Fix | Delete
);
[287] Fix | Delete
?>
[288] Fix | Delete
</p>
[289] Fix | Delete
[290] Fix | Delete
<# if ( data.suggestedWidth && data.suggestedHeight ) { #>
[291] Fix | Delete
<p class="suggested-dimensions">
[292] Fix | Delete
<?php
[293] Fix | Delete
/* translators: 1: Suggested width number, 2: Suggested height number. */
[294] Fix | Delete
printf( __( 'Suggested image dimensions: %1$s by %2$s pixels.' ), '{{data.suggestedWidth}}', '{{data.suggestedHeight}}' );
[295] Fix | Delete
?>
[296] Fix | Delete
</p>
[297] Fix | Delete
<# } #>
[298] Fix | Delete
[299] Fix | Delete
<?php
[300] Fix | Delete
/** This action is documented in wp-admin/includes/media.php */
[301] Fix | Delete
do_action( 'post-upload-ui' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
[302] Fix | Delete
?>
[303] Fix | Delete
</div>
[304] Fix | Delete
<?php endif; ?>
[305] Fix | Delete
</div>
[306] Fix | Delete
</script>
[307] Fix | Delete
[308] Fix | Delete
<?php // Template for the view switchers, used for example in the Media Grid. ?>
[309] Fix | Delete
<script type="text/html" id="tmpl-media-library-view-switcher">
[310] Fix | Delete
<a href="<?php echo esc_url( add_query_arg( 'mode', 'list', admin_url( 'upload.php' ) ) ); ?>" class="view-list">
[311] Fix | Delete
<span class="screen-reader-text"><?php _e( 'List view' ); ?></span>
[312] Fix | Delete
</a>
[313] Fix | Delete
<a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', admin_url( 'upload.php' ) ) ); ?>" class="view-grid current" aria-current="page">
[314] Fix | Delete
<span class="screen-reader-text"><?php _e( 'Grid view' ); ?></span>
[315] Fix | Delete
</a>
[316] Fix | Delete
</script>
[317] Fix | Delete
[318] Fix | Delete
<?php // Template for the uploading status UI. ?>
[319] Fix | Delete
<script type="text/html" id="tmpl-uploader-status">
[320] Fix | Delete
<h2><?php _e( 'Uploading' ); ?></h2>
[321] Fix | Delete
<button type="button" class="button-link upload-dismiss-errors"><span class="screen-reader-text"><?php _e( 'Dismiss Errors' ); ?></span></button>
[322] Fix | Delete
[323] Fix | Delete
<div class="media-progress-bar"><div></div></div>
[324] Fix | Delete
<div class="upload-details">
[325] Fix | Delete
<span class="upload-count">
[326] Fix | Delete
<span class="upload-index"></span> / <span class="upload-total"></span>
[327] Fix | Delete
</span>
[328] Fix | Delete
<span class="upload-detail-separator">&ndash;</span>
[329] Fix | Delete
<span class="upload-filename"></span>
[330] Fix | Delete
</div>
[331] Fix | Delete
<div class="upload-errors"></div>
[332] Fix | Delete
</script>
[333] Fix | Delete
[334] Fix | Delete
<?php // Template for the uploading status errors. ?>
[335] Fix | Delete
<script type="text/html" id="tmpl-uploader-status-error">
[336] Fix | Delete
<span class="upload-error-filename">{{{ data.filename }}}</span>
[337] Fix | Delete
<span class="upload-error-message">{{ data.message }}</span>
[338] Fix | Delete
</script>
[339] Fix | Delete
[340] Fix | Delete
<?php // Template for the Attachment Details layout in the media browser. ?>
[341] Fix | Delete
<script type="text/html" id="tmpl-edit-attachment-frame">
[342] Fix | Delete
<div class="edit-media-header">
[343] Fix | Delete
<button class="left dashicons"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button>
[344] Fix | Delete
<button class="right dashicons"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button>
[345] Fix | Delete
<button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button>
[346] Fix | Delete
</div>
[347] Fix | Delete
<div class="media-frame-title"></div>
[348] Fix | Delete
<div class="media-frame-content"></div>
[349] Fix | Delete
</script>
[350] Fix | Delete
[351] Fix | Delete
<?php // Template for the Attachment Details two columns layout. ?>
[352] Fix | Delete
<script type="text/html" id="tmpl-attachment-details-two-column">
[353] Fix | Delete
<div class="attachment-media-view {{ data.orientation }}">
[354] Fix | Delete
<h2 class="screen-reader-text"><?php _e( 'Attachment Preview' ); ?></h2>
[355] Fix | Delete
<div class="thumbnail thumbnail-{{ data.type }}">
[356] Fix | Delete
<# if ( data.uploading ) { #>
[357] Fix | Delete
<div class="media-progress-bar"><div></div></div>
[358] Fix | Delete
<# } else if ( data.sizes && data.sizes.large ) { #>
[359] Fix | Delete
<img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" alt="" />
[360] Fix | Delete
<# } else if ( data.sizes && data.sizes.full ) { #>
[361] Fix | Delete
<img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" alt="" />
[362] Fix | Delete
<# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #>
[363] Fix | Delete
<img class="details-image icon" src="{{ data.icon }}" draggable="false" alt="" />
[364] Fix | Delete
<# } #>
[365] Fix | Delete
[366] Fix | Delete
<# if ( 'audio' === data.type ) { #>
[367] Fix | Delete
<div class="wp-media-wrapper wp-audio">
[368] Fix | Delete
<audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none">
[369] Fix | Delete
<source type="{{ data.mime }}" src="{{ data.url }}"/>
[370] Fix | Delete
</audio>
[371] Fix | Delete
</div>
[372] Fix | Delete
<# } else if ( 'video' === data.type ) {
[373] Fix | Delete
var w_rule = '';
[374] Fix | Delete
if ( data.width ) {
[375] Fix | Delete
w_rule = 'width: ' + data.width + 'px;';
[376] Fix | Delete
} else if ( wp.media.view.settings.contentWidth ) {
[377] Fix | Delete
w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;';
[378] Fix | Delete
}
[379] Fix | Delete
#>
[380] Fix | Delete
<div style="{{ w_rule }}" class="wp-media-wrapper wp-video">
[381] Fix | Delete
<video controls="controls" class="wp-video-shortcode" preload="metadata"
[382] Fix | Delete
<# if ( data.width ) { #>width="{{ data.width }}"<# } #>
[383] Fix | Delete
<# if ( data.height ) { #>height="{{ data.height }}"<# } #>
[384] Fix | Delete
<# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>>
[385] Fix | Delete
<source type="{{ data.mime }}" src="{{ data.url }}"/>
[386] Fix | Delete
</video>
[387] Fix | Delete
</div>
[388] Fix | Delete
<# } #>
[389] Fix | Delete
[390] Fix | Delete
<div class="attachment-actions">
[391] Fix | Delete
<# if ( 'image' === data.type && ! data.uploading && data.sizes && data.can.save ) { #>
[392] Fix | Delete
<button type="button" class="button edit-attachment"><?php _e( 'Edit Image' ); ?></button>
[393] Fix | Delete
<# } else if ( 'pdf' === data.subtype && data.sizes ) { #>
[394] Fix | Delete
<p><?php _e( 'Document Preview' ); ?></p>
[395] Fix | Delete
<# } #>
[396] Fix | Delete
</div>
[397] Fix | Delete
</div>
[398] Fix | Delete
</div>
[399] Fix | Delete
<div class="attachment-info">
[400] Fix | Delete
<span class="settings-save-status" role="status">
[401] Fix | Delete
<span class="spinner"></span>
[402] Fix | Delete
<span class="saved"><?php esc_html_e( 'Saved.' ); ?></span>
[403] Fix | Delete
</span>
[404] Fix | Delete
<div class="details">
[405] Fix | Delete
<h2 class="screen-reader-text"><?php _e( 'Details' ); ?></h2>
[406] Fix | Delete
<div class="uploaded"><strong><?php _e( 'Uploaded on:' ); ?></strong> {{ data.dateFormatted }}</div>
[407] Fix | Delete
<div class="uploaded-by">
[408] Fix | Delete
<strong><?php _e( 'Uploaded by:' ); ?></strong>
[409] Fix | Delete
<# if ( data.authorLink ) { #>
[410] Fix | Delete
<a href="{{ data.authorLink }}">{{ data.authorName }}</a>
[411] Fix | Delete
<# } else { #>
[412] Fix | Delete
{{ data.authorName }}
[413] Fix | Delete
<# } #>
[414] Fix | Delete
</div>
[415] Fix | Delete
<# if ( data.uploadedToTitle ) { #>
[416] Fix | Delete
<div class="uploaded-to">
[417] Fix | Delete
<strong><?php _e( 'Uploaded to:' ); ?></strong>
[418] Fix | Delete
<# if ( data.uploadedToLink ) { #>
[419] Fix | Delete
<a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a>
[420] Fix | Delete
<# } else { #>
[421] Fix | Delete
{{ data.uploadedToTitle }}
[422] Fix | Delete
<# } #>
[423] Fix | Delete
</div>
[424] Fix | Delete
<# } #>
[425] Fix | Delete
<div class="filename"><strong><?php _e( 'File name:' ); ?></strong> {{ data.filename }}</div>
[426] Fix | Delete
<div class="file-type"><strong><?php _e( 'File type:' ); ?></strong> {{ data.mime }}</div>
[427] Fix | Delete
<div class="file-size"><strong><?php _e( 'File size:' ); ?></strong> {{ data.filesizeHumanReadable }}</div>
[428] Fix | Delete
<# if ( 'image' === data.type && ! data.uploading ) { #>
[429] Fix | Delete
<# if ( data.width && data.height ) { #>
[430] Fix | Delete
<div class="dimensions"><strong><?php _e( 'Dimensions:' ); ?></strong>
[431] Fix | Delete
<?php
[432] Fix | Delete
/* translators: 1: A number of pixels wide, 2: A number of pixels tall. */
[433] Fix | Delete
printf( __( '%1$s by %2$s pixels' ), '{{ data.width }}', '{{ data.height }}' );
[434] Fix | Delete
?>
[435] Fix | Delete
</div>
[436] Fix | Delete
<# } #>
[437] Fix | Delete
[438] Fix | Delete
<# if ( data.originalImageURL && data.originalImageName ) { #>
[439] Fix | Delete
<?php _e( 'Original image:' ); ?>
[440] Fix | Delete
<a href="{{ data.originalImageURL }}">{{data.originalImageName}}</a>
[441] Fix | Delete
<# } #>
[442] Fix | Delete
<# } #>
[443] Fix | Delete
[444] Fix | Delete
<# if ( data.fileLength && data.fileLengthHumanReadable ) { #>
[445] Fix | Delete
<div class="file-length"><strong><?php _e( 'Length:' ); ?></strong>
[446] Fix | Delete
<span aria-hidden="true">{{ data.fileLength }}</span>
[447] Fix | Delete
<span class="screen-reader-text">{{ data.fileLengthHumanReadable }}</span>
[448] Fix | Delete
</div>
[449] Fix | Delete
<# } #>
[450] Fix | Delete
[451] Fix | Delete
<# if ( 'audio' === data.type && data.meta.bitrate ) { #>
[452] Fix | Delete
<div class="bitrate">
[453] Fix | Delete
<strong><?php _e( 'Bitrate:' ); ?></strong> {{ Math.round( data.meta.bitrate / 1000 ) }}kb/s
[454] Fix | Delete
<# if ( data.meta.bitrate_mode ) { #>
[455] Fix | Delete
{{ ' ' + data.meta.bitrate_mode.toUpperCase() }}
[456] Fix | Delete
<# } #>
[457] Fix | Delete
</div>
[458] Fix | Delete
<# } #>
[459] Fix | Delete
[460] Fix | Delete
<# if ( data.mediaStates ) { #>
[461] Fix | Delete
<div class="media-states"><strong><?php _e( 'Used as:' ); ?></strong> {{ data.mediaStates }}</div>
[462] Fix | Delete
<# } #>
[463] Fix | Delete
[464] Fix | Delete
<div class="compat-meta">
[465] Fix | Delete
<# if ( data.compat && data.compat.meta ) { #>
[466] Fix | Delete
{{{ data.compat.meta }}}
[467] Fix | Delete
<# } #>
[468] Fix | Delete
</div>
[469] Fix | Delete
</div>
[470] Fix | Delete
[471] Fix | Delete
<div class="settings">
[472] Fix | Delete
<# var maybeReadOnly = data.can.save || data.allowLocalEdits ? '' : 'readonly'; #>
[473] Fix | Delete
<# if ( 'image' === data.type ) { #>
[474] Fix | Delete
<span class="setting has-description" data-setting="alt">
[475] Fix | Delete
<label for="attachment-details-two-column-alt-text" class="name"><?php _e( 'Alternative Text' ); ?></label>
[476] Fix | Delete
<input type="text" id="attachment-details-two-column-alt-text" value="{{ data.alt }}" aria-describedby="alt-text-description" {{ maybeReadOnly }} />
[477] Fix | Delete
</span>
[478] Fix | Delete
<p class="description" id="alt-text-description"><?php echo $alt_text_description; ?></p>
[479] Fix | Delete
<# } #>
[480] Fix | Delete
<?php if ( post_type_supports( 'attachment', 'title' ) ) : ?>
[481] Fix | Delete
<span class="setting" data-setting="title">
[482] Fix | Delete
<label for="attachment-details-two-column-title" class="name"><?php _e( 'Title' ); ?></label>
[483] Fix | Delete
<input type="text" id="attachment-details-two-column-title" value="{{ data.title }}" {{ maybeReadOnly }} />
[484] Fix | Delete
</span>
[485] Fix | Delete
<?php endif; ?>
[486] Fix | Delete
<# if ( 'audio' === data.type ) { #>
[487] Fix | Delete
<?php
[488] Fix | Delete
foreach ( array(
[489] Fix | Delete
'artist' => __( 'Artist' ),
[490] Fix | Delete
'album' => __( 'Album' ),
[491] Fix | Delete
) as $key => $label ) :
[492] Fix | Delete
?>
[493] Fix | Delete
<span class="setting" data-setting="<?php echo esc_attr( $key ); ?>">
[494] Fix | Delete
<label for="attachment-details-two-column-<?php echo esc_attr( $key ); ?>" class="name"><?php echo $label; ?></label>
[495] Fix | Delete
<input type="text" id="attachment-details-two-column-<?php echo esc_attr( $key ); ?>" value="{{ data.<?php echo $key; ?> || data.meta.<?php echo $key; ?> || '' }}" />
[496] Fix | Delete
</span>
[497] Fix | Delete
<?php endforeach; ?>
[498] Fix | Delete
<# } #>
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function