Update WordPress to 5.2
This commit is contained in:
parent
489b5a5914
commit
e00f87f2f5
599 changed files with 119573 additions and 55990 deletions
|
|
@ -175,37 +175,60 @@ class WP_Widget_Media_Gallery extends WP_Widget_Media {
|
|||
parent::render_control_template_scripts();
|
||||
?>
|
||||
<script type="text/html" id="tmpl-wp-media-widget-gallery-preview">
|
||||
<# var describedById = 'describedBy-' + String( Math.random() ); #>
|
||||
<#
|
||||
var ids = _.filter( data.ids, function( id ) {
|
||||
return ( id in data.attachments );
|
||||
} );
|
||||
#>
|
||||
<# if ( ids.length ) { #>
|
||||
<div class="gallery media-widget-gallery-preview">
|
||||
<ul class="gallery media-widget-gallery-preview" role="list">
|
||||
<# _.each( ids, function( id, index ) { #>
|
||||
<# var attachment = data.attachments[ id ]; #>
|
||||
<# if ( index < 6 ) { #>
|
||||
<dl class="gallery-item">
|
||||
<dt class="gallery-icon">
|
||||
<# if ( attachment.sizes.thumbnail ) { #>
|
||||
<img src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}" alt="" />
|
||||
<# } else { #>
|
||||
<img src="{{ attachment.url }}" alt="" />
|
||||
<# } #>
|
||||
<# if ( index === 5 && ids.length > 6 ) { #>
|
||||
<li class="gallery-item">
|
||||
<div class="gallery-icon">
|
||||
<img alt="{{ attachment.alt }}"
|
||||
<# if ( index === 5 && data.ids.length > 6 ) { #> aria-hidden="true" <# } #>
|
||||
<# if ( attachment.sizes.thumbnail ) { #>
|
||||
src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}"
|
||||
<# } else { #>
|
||||
src="{{ attachment.url }}"
|
||||
<# } #>
|
||||
<# if ( ! attachment.alt && attachment.filename ) { #>
|
||||
aria-label="
|
||||
<?php
|
||||
echo esc_attr(
|
||||
sprintf(
|
||||
/* translators: %s: the image file name. */
|
||||
__( 'The current image has no alternative text. The file name is: %s' ),
|
||||
'{{ attachment.filename }}'
|
||||
)
|
||||
);
|
||||
?>
|
||||
"
|
||||
<# } #>
|
||||
/>
|
||||
<# if ( index === 5 && data.ids.length > 6 ) { #>
|
||||
<div class="gallery-icon-placeholder">
|
||||
<p class="gallery-icon-placeholder-text">+{{ ids.length - 5 }}</p>
|
||||
<p class="gallery-icon-placeholder-text" aria-label="
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: the amount of additional, not visible images in the gallery widget preview. */
|
||||
__( 'Additional images added to this gallery: %s' ),
|
||||
'{{ data.ids.length - 5 }}'
|
||||
);
|
||||
?>
|
||||
">+{{ data.ids.length - 5 }}</p>
|
||||
</div>
|
||||
<# } #>
|
||||
</dt>
|
||||
</dl>
|
||||
<# } #>
|
||||
</div>
|
||||
</li>
|
||||
<# } #>
|
||||
<# } ); #>
|
||||
</div>
|
||||
</ul>
|
||||
<# } else { #>
|
||||
<div class="attachment-media-view">
|
||||
<p class="placeholder"><?php echo esc_html( $this->l10n['no_media_selected'] ); ?></p>
|
||||
<button type="button" class="placeholder button-add-media"><?php echo esc_html( $this->l10n['add_media'] ); ?></button>
|
||||
</div>
|
||||
<# } #>
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue