WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/30/2020 01:14:05 PM (10 months ago)
Author:
afercia
Message:

Accessibility: Media: Add a "Copy URL" button to the attachment File URL fields.

For a number of years, various screens in the WordPress admin provided users with a readonly input field to copy the attachment file URL. Manually copying from a readonly field is an annoying task at best even for mouser users. It's a usability and accessibility issue at the same time.
These fields now have a new "Copy URL" button that is easy to use and accessible to everyone.

Props theolg, markdubois, vabrashev, sajjad67, xkon, nrqsnchz, melchoyce, audrasjb, afercia.
See #41612, #50322, #50335.
Fixes #48463.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r48199 r48232  
    32693269        <label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
    32703270        <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
     3271        <span class="copy-to-clipboard-container">
     3272            <button type="button" class="button copy-attachment-url edit-media" data-clipboard-target="#attachment_url"><?php _e( 'Copy URL' ); ?></button>
     3273            <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
     3274        </span>
    32713275    </div>
    32723276    <div class="misc-pub-section misc-pub-filename">
Note: See TracChangeset for help on using the changeset viewer.