Make WordPress Core


Ignore:
Timestamp:
09/21/2016 05:53:29 PM (9 years ago)
Author:
afercia
Message:

Accessibility: Add Themes Feature Filter form improvements.

  • adds "Apply Filters" and "Clear" at the end of the form
  • changes the "Feature Filter", "Apply Filters", "Clear", and "Edit" links in <button> elements
  • removes a leftover from [27963]
  • clarifies one button text and adds an aria-label attribute
  • adds a wp.a11y.speak() message when clicking on "Apply Filters" and no features are selected

Fixes #38086.

File:
1 edited

Legend:

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

    r38071 r38640  
    3838    'themes'   => false,
    3939    'settings' => array(
    40         'isInstall'     => true,
    41         'canInstall'    => current_user_can( 'install_themes' ),
    42         'installURI'    => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
    43         'adminUrl'      => parse_url( self_admin_url(), PHP_URL_PATH )
     40        'isInstall'  => true,
     41        'canInstall' => current_user_can( 'install_themes' ),
     42        'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
     43        'adminUrl'   => parse_url( self_admin_url(), PHP_URL_PATH )
    4444    ),
    4545    'l10n' => array(
    46         'addNew' => __( 'Add New Theme' ),
    47         'search' => __( 'Search Themes' ),
    48         'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
    49         'upload' => __( 'Upload Theme' ),
    50         'back'   => __( 'Back' ),
    51         'error'  => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
    52         'themesFound'   => __( 'Number of Themes found: %d' ),
    53         'noThemesFound' => __( 'No themes found. Try a different search.' ),
    54         'collapseSidebar'    => __( 'Collapse Sidebar' ),
    55         'expandSidebar'      => __( 'Expand Sidebar' ),
     46        'addNew'              => __( 'Add New Theme' ),
     47        'search'              => __( 'Search Themes' ),
     48        'searchPlaceholder'   => __( 'Search themes...' ), // placeholder (no ellipsis)
     49        'upload'              => __( 'Upload Theme' ),
     50        'back'                => __( 'Back' ),
     51        'error'               => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ),
     52        'themesFound'         => __( 'Number of Themes found: %d' ),
     53        'noThemesFound'       => __( 'No themes found. Try a different search.' ),
     54        'collapseSidebar'     => __( 'Collapse Sidebar' ),
     55        'expandSidebar'       => __( 'Expand Sidebar' ),
     56        /* translators: hidden accessibility text */
     57        'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
    5658    ),
    5759    'installedThemes' => array_keys( $installed_themes ),
     
    153155        </ul>
    154156
    155         <a class="drawer-toggle" href="#"><?php _e( 'Feature Filter' ); ?></a>
     157        <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
    156158
    157159        <div class="search-form"></div>
     
    179181        <div class="filter-drawer">
    180182            <div class="buttons">
    181                 <a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a>
    182                 <a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a>
     183                <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
     184                <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
    183185            </div>
    184186        <?php
     
    198200        }
    199201        ?>
     202            <div class="buttons">
     203                <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
     204                <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
     205            </div>
    200206            <div class="filtered-by">
    201207                <span><?php _e( 'Filtering by:' ); ?></span>
    202208                <div class="tags"></div>
    203                 <a href="#"><?php _e( 'Edit' ); ?></a>
     209                <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
    204210            </div>
    205211        </div>
Note: See TracChangeset for help on using the changeset viewer.