Changeset 51023 for trunk/src/wp-admin/async-upload.php
- Timestamp:
- 05/26/2021 01:39:47 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/async-upload.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/async-upload.php
r50505 r51023 49 49 switch ( $_REQUEST['fetch'] ) { 50 50 case 3: 51 echo '<div class="attachment-details">'; 51 52 $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); 52 53 if ( $thumb_url ) { 53 54 echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; 54 55 } 55 if ( current_user_can( 'edit_post', $id ) ) { 56 echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; 57 } else { 58 echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>'; 59 } 56 // Title shouldn't ever be empty, but use filename just in case. 57 $file = get_attached_file( $post->ID ); 58 $fileurl = wp_get_attachment_url( $post->ID ); 59 $title = $post->post_title ? $post->post_title : wp_basename( $file ); 60 60 61 // Title shouldn't ever be empty, but use filename just in case. 62 $file = get_attached_file( $post->ID ); 63 $title = $post->post_title ? $post->post_title : wp_basename( $file ); 64 echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</span></div>'; 61 echo '<div class="filename new"><span class="media-list-title"><strong>' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</strong></span> <span class="media-list-subtitle">' . basename( $file ) . '</span></div>'; 62 echo '</div>'; 63 ?> 64 <div class="attachment-tools"> 65 <span class="media-item-copy-container copy-to-clipboard-container edit-attachment"> 66 <button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo $fileurl; ?>"><?php _e( 'Copy URL to clipboard' ); ?></button> 67 <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> 68 </span> 69 <?php 70 if ( current_user_can( 'edit_post', $id ) ) { 71 echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; 72 } else { 73 echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>'; 74 } 75 ?> 76 </div> 77 <?php 65 78 break; 66 79 case 2:
Note: See TracChangeset
for help on using the changeset viewer.