diff --git a/src/js/_enqueues/vendor/plupload/handlers.js b/src/js/_enqueues/vendor/plupload/handlers.js index aaf1519aff..7958e7231d 100644 --- a/src/js/_enqueues/vendor/plupload/handlers.js +++ b/src/js/_enqueues/vendor/plupload/handlers.js @@ -372,10 +372,12 @@ function wpFileExtensionError( up, file, message ) { */ function copyAttachmentUploadURLClipboard() { var clipboard = new ClipboardJS( '.copy-attachment-url' ), - successTimeout; + successTimeout; + clipboard.on( 'success', function( event ) { var triggerElement = jQuery( event.trigger ), successElement = jQuery( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) ); + // Clear the selection and move focus back to the trigger. event.clearSelection(); // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php index 9c0190a198..6e04e0a19a 100644 --- a/src/wp-admin/async-upload.php +++ b/src/wp-admin/async-upload.php @@ -48,22 +48,27 @@ if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && switch ( $_REQUEST['fetch'] ) { case 3: - echo '
'; - $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); - if ( $thumb_url ) { - echo ''; - } - // Title shouldn't ever be empty, but use filename just in case. - $file = get_attached_file( $post->ID ); - $fileurl = wp_get_attachment_url( $post->ID ); - $title = $post->post_title ? $post->post_title : wp_basename( $file ); - - echo '
' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . ' ' . basename( $file ) . '
'; - echo '
'; ?> +
+ '; + } + + // Title shouldn't ever be empty, but use filename just in case. + $file = get_attached_file( $post->ID ); + $file_url = wp_get_attachment_url( $post->ID ); + $title = $post->post_title ? $post->post_title : wp_basename( $file ); + ?> +
+ + +
+
- +