WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/08/2021 10:47:09 PM (2 months ago)
Author:
antpb
Message:

Media: Change upload button to a file input for better e2e targeting.

Changes the media library upload button to input type="file" for better end to end testing capabilities.

Props justinahinon, joedolson, sabernhardt, audrasjb.
Fixes #54168.

File:
1 edited

Legend:

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

    r52033 r52059  
    253253                <h2 class="upload-instructions drop-instructions"><?php _e( 'Drop files to upload' ); ?></h2>
    254254                <p class="upload-instructions drop-instructions"><?php _ex( 'or', 'Uploader: Drop files here - or - Select Files' ); ?></p>
    255                 <button type="button" class="browser button button-hero" aria-labelledby="post-upload-info"><?php _e( 'Select Files' ); ?></button>
     255                <div class="browser-container">
     256                    <label class="button button-hero"><?php esc_html_e( 'Select Files' ); ?></label>
     257                    <input type="file" class="browser screen-reader-text" aria-describedby="post-upload-info">
     258                </div>
    256259            </div>
    257260
Note: See TracChangeset for help on using the changeset viewer.