Make WordPress Core


Ignore:
Timestamp:
02/27/2015 02:49:05 AM (11 years ago)
Author:
azaozz
Message:

PressThis: accessibility enhancements:

  • Add missing form labels.
  • Add some screen-reader-text and aria-hidden attributes.
  • Focus handling improvements.
  • Change tagcloud-link into a button.
  • Add missing ID attribute in tools.php.

Props afercia. Fixes #31449.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-press-this.php

    r31556 r31566  
    538538                                ?>
    539539                                <div id="post-formats-select">
     540                                <fieldset><legend class="screen-reader-text"><?php _e( 'Post formats' ); ?></legend>
    540541                                        <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> />
    541542                                        <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
     
    551552                                         }
    552553                                         ?>
     554                                </fieldset>
    553555                                </div>
    554556                                <?php
     
    570572                if ( current_user_can( $taxonomy->cap->edit_terms ) ) {
    571573                        ?>
    572                         <button type="button" class="add-cat-toggle button-subtle">
    573                                 <span class="dashicons dashicons-plus"></span>
     574                        <button type="button" class="add-cat-toggle button-subtle" aria-expanded="false">
     575                                <span class="dashicons dashicons-plus"></span><span class="screen-reader-text"><?php _e( 'Toggle add category' ); ?></span>
    574576                        </button>
    575577                        <div class="add-category is-hidden">
     
    593595                <?php } ?>
    594596                <div class="categories-search-wrapper">
    595                         <input id="categories-search" type="search" class="categories-search" placeholder="<?php esc_attr_e( 'Search categories' ) ?>">
     597                        <input id="categories-search" type="search" class="categories-search" placeholder="<?php esc_attr_e( 'Search categories by name' ) ?>">
    596598                        <label for="categories-search">
    597                                 <span class="dashicons dashicons-search"></span>
     599                                <span class="dashicons dashicons-search"></span><span class="screen-reader-text"><?php _e( 'Search categories' ); ?></span>
    598600                        </label>
    599601                </div>
    600                 <ul class="categories-select">
     602                <ul class="categories-select" aria-label="<?php esc_attr_e( 'Categories' ); ?>">
    601603                        <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => 'category' ) ); ?>
    602604                </ul>
     
    646648                if ( $user_can_assign_terms ) {
    647649                        ?>
    648                         <p>
    649                                 <a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php echo $taxonomy->labels->choose_from_most_used; ?></a>
    650                         </p>
     650                        <button type="button" class="button-reset button-link tagcloud-link" id="link-post_tag"><?php echo $taxonomy->labels->choose_from_most_used; ?></button>
    651651                        <?php
    652652                }
     
    757757        <div id="scanbar" class="scan">
    758758                <form method="GET">
     759                        <label for="url-scan" class="screen-reader-text"><?php _e( 'Scan site for content' ); ?></label>
    759760                        <input type="url" name="u" id="url-scan" class="scan-url" value="" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
    760761                        <input type="submit" name="url-scan-submit" id="url-scan-submit" class="scan-submit" value="<?php esc_attr_e( 'Scan' ) ?>" />
     
    843844                                <div class="setting-modal is-off-screen is-hidden">
    844845                                        <button type="button" class="button-reset modal-close">
    845                                                 <span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title"><?php _e( 'Post format' ); ?></span>
     846                                                <span class="dashicons dashicons-arrow-left-alt2"></span>
     847                                                <span class="setting-title" aria-hidden="true"><?php _e( 'Post format' ); ?></span>
     848                                                <span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
    846849                                        </button>
    847850                                        <?php $this->post_formats_html( $post ); ?>
     
    850853
    851854                        <div class="setting-modal is-off-screen is-hidden">
    852                                 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title"><?php _e( 'Categories' ); ?></span></button>
     855                                <button type="button" class="button-reset modal-close">
     856                                        <span class="dashicons dashicons-arrow-left-alt2"></span>
     857                                        <span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
     858                                        <span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
     859                                </button>
    853860                                <?php $this->categories_html( $post ); ?>
    854861                        </div>
    855862
    856863                        <div class="setting-modal tags is-off-screen is-hidden">
    857                                 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title"><?php _e( 'Tags' ); ?></span></button>
     864                                <button type="button" class="button-reset modal-close">
     865                                        <span class="dashicons dashicons-arrow-left-alt2"></span>
     866                                        <span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
     867                                        <span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
     868                                </button>
    858869                                <?php $this->tags_html( $post ); ?>
    859870                        </div>
     
    877888        <?php
    878889
    879                 // TODO: consider running "special" press-this hooks here?
    880                 // Maybe better so we don't output stuff accidentally added by plugins. Would probably prevent some errors.
    881890                do_action( 'admin_footer', '' );
    882891                do_action( 'admin_print_footer_scripts' );
Note: See TracChangeset for help on using the changeset viewer.