Ticket #43137: 43137.diff
File 43137.diff, 4.7 KB (added by , 7 years ago) |
---|
-
src/wp-includes/widgets/class-wp-widget-media-gallery.php
172 172 parent::render_control_template_scripts(); 173 173 ?> 174 174 <script type="text/html" id="tmpl-wp-media-widget-gallery-preview"> 175 <# var describedById = 'describedBy-' + String( Math.random() ); #>176 175 <# if ( data.ids.length ) { #> 177 < div class="gallery media-widget-gallery-preview">176 <ul class="gallery media-widget-gallery-preview" role="list"> 178 177 <# _.each( data.ids, function( id, index ) { #> 179 178 <# 180 179 var attachment = data.attachments[ id ]; … … 183 182 } 184 183 #> 185 184 <# if ( index < 6 ) { #> 186 <dl class="gallery-item"> 187 <dt class="gallery-icon"> 188 <# if ( attachment.sizes.thumbnail ) { #> 189 <img src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}" alt="" /> 190 <# } else { #> 191 <img src="{{ attachment.url }}" alt="" /> 192 <# } #> 193 <# if ( index === 5 && data.ids.length > 6 ) { #> 185 <li class="gallery-item"> 186 <div class="gallery-icon"> 187 <img alt="{{ attachment.alt }}" 188 <# if ( index === 5 && data.ids.length > 6 ) { #> aria-hidden="true" <# } #> 189 <# if ( attachment.sizes.thumbnail ) { #> 190 src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}" 191 <# } else { #> 192 src="{{ attachment.url }}" 193 <# } #> 194 <# if ( ! attachment.alt && attachment.filename ) { #> 195 aria-label="<?php echo esc_attr( sprintf( 196 /* translators: %s is the image file name. */ 197 __( 'Current image has no alternative text. The file name is: %s' ), 198 '{{ attachment.filename }}' 199 ) ); ?>" 200 <# } #> 201 /> 202 <# if ( index === 5 && data.ids.length > 6 ) { #> 194 203 <div class="gallery-icon-placeholder"> 195 <p class="gallery-icon-placeholder-text">+{{ data.ids.length - 5 }}</p> 204 <p class="gallery-icon-placeholder-text" 205 aria-label="<?php 206 printf( 207 /* translators: %s is the amount of additional, not visible images in the gallery widget preview. */ 208 __( 'Additional images added to this gallery: %s' ), 209 '{{ data.ids.length - 5 }}' 210 ); 211 ?>" 212 >+{{ data.ids.length - 5 }}</p> 196 213 </div> 197 <# } #>198 </d t>199 </ dl>214 <# } #> 215 </div> 216 </li> 200 217 <# } #> 201 218 <# } ); #> 202 </ div>219 </ul> 203 220 <# } else { #> 204 221 <div class="attachment-media-view"> 205 222 <p class="placeholder"><?php echo esc_html( $this->l10n['no_media_selected'] ); ?></p> -
src/wp-includes/widgets/class-wp-widget-media-image.php
334 334 <# } #> 335 335 </script> 336 336 <script type="text/html" id="tmpl-wp-media-widget-image-preview"> 337 <# var describedById = 'describedBy-' + String( Math.random() ); #>338 337 <# if ( data.error && 'missing_attachment' === data.error ) { #> 339 338 <div class="notice notice-error notice-alt notice-missing-attachment"> 340 339 <p><?php echo $this->l10n['missing_attachment']; ?></p> … … 344 343 <p><?php _e( 'Unable to preview media due to an unknown error.' ); ?></p> 345 344 </div> 346 345 <# } else if ( data.url ) { #> 347 <img class="attachment-thumb" src="{{ data.url }}" draggable="false" alt="{{ data.alt }}" <# if ( ! data.alt && data.currentFilename ) { #> aria-describedby="{{ describedById }}" <# } #> />348 <# if ( ! data.alt && data.currentFilename ) { #>349 <p class="hidden" id="{{ describedById }}">350 <?php351 /* translators: placeholder is image filename */352 echo sprintf( __( 'Current image: %s' ), '{{ data.currentFilename }}' );353 ?>354 < /p>355 <# } #>346 <img class="attachment-thumb" src="{{ data.url }}" draggable="false" alt="{{ data.alt }}" 347 <# if ( ! data.alt && data.currentFilename ) { #> 348 aria-label="<?php echo esc_attr( sprintf( 349 /* translators: %s is the image file name. */ 350 __( 'Current image has no alternative text. The file name is: %s' ), 351 '{{ data.currentFilename }}' 352 ) ); ?>" 353 <# } #> 354 /> 356 355 <# } #> 357 356 </script> 358 357 <?php