Make WordPress Core

Ticket #63238: 63238.button-role.diff

File 63238.button-role.diff, 1.8 KB (added by sabernhardt, 5 months ago)

adds role="button" plus spacebar usability, while keeping the existing strings

  • src/js/_enqueues/vendor/plupload/handlers.js

     
    461461                }
    462462        });
    463463
     464        $( '.upload-flash-bypass a[role="button"], .upload-html-bypass a[role="button"]' ).on( 'keydown.uploader', function( e ) {
     465                if ( e.code === 'Space' ) {
     466                        $( this ).trigger( 'click' );
     467                }
     468        });
     469
    464470        // Attempt to create image sub-sizes when an image was uploaded successfully
    465471        // but the server responded with an HTTP 5xx error.
    466472        tryAgain = function( up, error ) {
  • src/wp-admin/includes/media.php

     
    30483048                        /* translators: 1: URL to browser uploader, 2: Additional link attributes. */
    30493049                        __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" %2$s>browser uploader</a> instead.' ),
    30503050                        $browser_uploader,
    3051                         'target="_blank"'
     3051                        'role="button"'
    30523052                );
    30533053        ?>
    30543054        </p>
     
    30613061 * @since 2.6.0
    30623062 */
    30633063function media_upload_html_bypass() {
     3064        $bypass_message = __( 'You are using the browser&#8217;s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.' );
    30643065        ?>
    30653066        <p class="upload-html-bypass hide-if-no-js">
    3066                 <?php _e( 'You are using the browser&#8217;s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.' ); ?>
     3067                <?php echo str_replace( '<a href="#">', '<a href="#" role="button">', $bypass_message ); ?>
    30673068        </p>
    30683069        <?php
    30693070}