WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/05/2019 05:49:00 PM (4 months ago)
Author:
afercia
Message:

Accessibility: Replace media placeholder clickable divs with buttons.

<button> elements are natively interactive, supported by any assistive technology, and must be used instead of non-semantic, non-accessible <div> elements.

Also, this change aligns the Media Widgets and the Customizer site icon and site logo controls with the design pattern used in the new Block Editor for similar controls.

Props ramonopoly, welcher, afercia.
Fixes #43151.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-media.php

    r43571 r44796  
    412412            <div class="media-widget-preview <?php echo esc_attr( $this->id_base ); ?>">
    413413                <div class="attachment-media-view">
    414                     <div class="placeholder"><?php echo esc_html( $this->l10n['no_media_selected'] ); ?></div>
     414                    <button type="button" class="select-media button-add-media not-selected">
     415                        <?php echo esc_html( $this->l10n['add_media'] ); ?>
     416                    </button>
    415417                </div>
    416418            </div>
     
    424426                </button>
    425427            <?php endif; ?>
    426                 <button type="button" class="button select-media not-selected">
    427                     <?php echo esc_html( $this->l10n['add_media'] ); ?>
    428                 </button>
    429428            </p>
    430429            <div class="media-widget-fields">
Note: See TracChangeset for help on using the changeset viewer.