Make WordPress Core


Ignore:
Timestamp:
07/10/2020 06:16:06 AM (6 years ago)
Author:
whyisjake
Message:

Upgrade/Install: Use ARIA button class on plugin and theme auto-updates action links

According to the [accesability guidelines](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/#semantics-for-controls), the control should be a link when JavaScript is not available and a button the rest of the time.

In addition, handlers were added for spacebar usage, and some changes to the a11y speak verbiage.

Fixes #50516.
Props ryokuhi, audrasjb, afercia, whyisjake/

File:
1 edited

Legend:

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

    r48115 r48418  
    563563        <div class="theme-autoupdate">
    564564            <# if ( data.autoupdate ) { #>
    565                 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable">
    566                     <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>
    567                     <span class="label">' . __( 'Disable auto-updates' ) . '</span>
    568                 </a>
     565                <button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable">
     566                    <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Disable auto-updates' ) . '</span>
     567                </button>
    569568            <# } else { #>
    570                 <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="enable">
    571                     <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>
    572                     <span class="label">' . __( 'Enable auto-updates' ) . '</span>
     569                <button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable">
     570                    <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Enable auto-updates' ) . '</span>
    573571                </a>
    574572            <# } #>
Note: See TracChangeset for help on using the changeset viewer.