WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/05/2019 05:49:00 PM (7 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-gallery.php

    r44767 r44796  
    229229            <# } else { #>
    230230                <div class="attachment-media-view">
    231                     <p class="placeholder"><?php echo esc_html( $this->l10n['no_media_selected'] ); ?></p>
     231                    <button type="button" class="placeholder button-add-media"><?php echo esc_html( $this->l10n['add_media'] ); ?></button>
    232232                </div>
    233233            <# } #>
Note: See TracChangeset for help on using the changeset viewer.