Changeset 44767
- Timestamp:
- 02/23/2019 06:31:05 PM (6 years ago)
- Location:
- trunk/src/wp-includes/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-media-gallery.php
r44661 r44767 176 176 ?> 177 177 <script type="text/html" id="tmpl-wp-media-widget-gallery-preview"> 178 <# var describedById = 'describedBy-' + String( Math.random() ); #>179 178 <# 180 179 var ids = _.filter( data.ids, function( id ) { … … 183 182 #> 184 183 <# if ( ids.length ) { #> 185 < div class="gallery media-widget-gallery-preview">184 <ul class="gallery media-widget-gallery-preview" role="list"> 186 185 <# _.each( ids, function( id, index ) { #> 187 186 <# var attachment = data.attachments[ id ]; #> 188 187 <# if ( index < 6 ) { #> 189 <dl class="gallery-item"> 190 <dt class="gallery-icon"> 191 <# if ( attachment.sizes.thumbnail ) { #> 192 <img src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}" alt="" /> 193 <# } else { #> 194 <img src="{{ attachment.url }}" alt="" /> 195 <# } #> 196 <# if ( index === 5 && ids.length > 6 ) { #> 188 <li class="gallery-item"> 189 <div class="gallery-icon"> 190 <img alt="{{ attachment.alt }}" 191 <# if ( index === 5 && data.ids.length > 6 ) { #> aria-hidden="true" <# } #> 192 <# if ( attachment.sizes.thumbnail ) { #> 193 src="{{ attachment.sizes.thumbnail.url }}" width="{{ attachment.sizes.thumbnail.width }}" height="{{ attachment.sizes.thumbnail.height }}" 194 <# } else { #> 195 src="{{ attachment.url }}" 196 <# } #> 197 <# if ( ! attachment.alt && attachment.filename ) { #> 198 aria-label=" 199 <?php 200 echo esc_attr( 201 sprintf( 202 /* translators: %s: the image file name. */ 203 __( 'The current image has no alternative text. The file name is: %s' ), 204 '{{ attachment.filename }}' 205 ) 206 ); 207 ?> 208 " 209 <# } #> 210 /> 211 <# if ( index === 5 && data.ids.length > 6 ) { #> 197 212 <div class="gallery-icon-placeholder"> 198 <p class="gallery-icon-placeholder-text">+{{ ids.length - 5 }}</p> 213 <p class="gallery-icon-placeholder-text" aria-label=" 214 <?php 215 printf( 216 /* translators: %s: the amount of additional, not visible images in the gallery widget preview. */ 217 __( 'Additional images added to this gallery: %s' ), 218 '{{ data.ids.length - 5 }}' 219 ); 220 ?> 221 ">+{{ data.ids.length - 5 }}</p> 199 222 </div> 200 <# } #>201 </d t>202 </ dl>223 <# } #> 224 </div> 225 </li> 203 226 <# } #> 204 227 <# } ); #> 205 </ div>228 </ul> 206 229 <# } else { #> 207 230 <div class="attachment-media-view"> -
trunk/src/wp-includes/widgets/class-wp-widget-media-image.php
r43571 r44767 340 340 </script> 341 341 <script type="text/html" id="tmpl-wp-media-widget-image-preview"> 342 <# var describedById = 'describedBy-' + String( Math.random() ); #>343 342 <# if ( data.error && 'missing_attachment' === data.error ) { #> 344 343 <div class="notice notice-error notice-alt notice-missing-attachment"> … … 350 349 </div> 351 350 <# } else if ( data.url ) { #> 352 <img class="attachment-thumb" src="{{ data.url }}" draggable="false" alt="{{ data.alt }}" <# if ( ! data.alt && data.currentFilename ) { #> aria-describedby="{{ describedById }}" <# } #> /> 353 <# if ( ! data.alt && data.currentFilename ) { #> 354 <p class="hidden" id="{{ describedById }}"> 355 <?php 356 /* translators: %s: image filename */ 357 echo sprintf( __( 'Current image: %s' ), '{{ data.currentFilename }}' ); 358 ?> 359 </p> 360 <# } #> 351 <img class="attachment-thumb" src="{{ data.url }}" draggable="false" alt="{{ data.alt }}" 352 <# if ( ! data.alt && data.currentFilename ) { #> 353 aria-label=" 354 <?php 355 echo esc_attr( 356 sprintf( 357 /* translators: %s: the image file name. */ 358 __( 'The current image has no alternative text. The file name is: %s' ), 359 '{{ data.currentFilename }}' 360 ) 361 ); 362 ?> 363 " 364 <# } #> 365 /> 361 366 <# } #> 362 367 </script>
Note: See TracChangeset
for help on using the changeset viewer.