Changeset 51195
- Timestamp:
- 06/22/2021 04:25:16 AM (3 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/async-upload.php
r51030 r51195 50 50 case 3: 51 51 ?> 52 <div class="attachment-details"> 53 <?php 54 $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); 55 if ( $thumb_url ) { 56 echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; 57 } 52 <div class="media-item-wrapper"> 53 <div class="attachment-details"> 54 <?php 55 $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); 56 if ( $thumb_url ) { 57 echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; 58 } 58 59 59 // Title shouldn't ever be empty, but use filename just in case. 60 $file = get_attached_file( $post->ID ); 61 $file_url = wp_get_attachment_url( $post->ID ); 62 $title = $post->post_title ? $post->post_title : wp_basename( $file ); 63 ?> 64 <div class="filename new"> 65 <span class="media-list-title"><strong><?php echo esc_html( wp_html_excerpt( $title, 60, '…' ) ); ?></strong></span> 66 <span class="media-list-subtitle"><?php echo wp_basename( $file ); ?></span> 60 // Title shouldn't ever be empty, but use filename just in case. 61 $file = get_attached_file( $post->ID ); 62 $file_url = wp_get_attachment_url( $post->ID ); 63 $title = $post->post_title ? $post->post_title : wp_basename( $file ); 64 ?> 65 <div class="filename new"> 66 <span class="media-list-title"><strong><?php echo esc_html( wp_html_excerpt( $title, 60, '…' ) ); ?></strong></span> 67 <span class="media-list-subtitle"><?php echo wp_basename( $file ); ?></span> 68 </div> 67 69 </div> 68 </div>69 <div class="attachment-tools">70 <span class="media-item-copy-container copy-to-clipboard-container edit-attachment">71 <button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo $file_url; ?>"><?php _e( 'Copy URL to clipboard' ); ?></button>72 < span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>73 </span>74 <?php75 if ( current_user_can( 'edit_post', $id ) ) {76 echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';77 } else {78 echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>';79 }80 ?>70 <div class="attachment-tools"> 71 <span class="media-item-copy-container copy-to-clipboard-container edit-attachment"> 72 <button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo $file_url; ?>"><?php _e( 'Copy URL to clipboard' ); ?></button> 73 <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> 74 </span> 75 <?php 76 if ( current_user_can( 'edit_post', $id ) ) { 77 echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; 78 } else { 79 echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>'; 80 } 81 ?> 82 </div> 81 83 </div> 82 84 <?php -
trunk/src/wp-admin/css/media.css
r51030 r51195 113 113 } 114 114 115 .media-item {115 .media-item-wrapper { 116 116 display: grid; 117 grid-template-columns: repeat( 2, 1fr );117 grid-template-columns: 1fr 1fr; 118 118 } 119 119 … … 254 254 .media-upload-form .media-item .error { 255 255 padding: 10px 0 10px 14px; 256 min-height: 50px; 256 257 } 257 258 … … 1288 1289 } 1289 1290 1291 @media only screen and (max-width: 600px) { 1292 .media-item-wrapper { 1293 grid-template-columns: 1fr; 1294 } 1295 } 1296 1290 1297 /** 1291 1298 * Media queries for media grid.
Note: See TracChangeset
for help on using the changeset viewer.