WordPress.org

Make WordPress Core

Changeset 21323


Ignore:
Timestamp:
07/25/2012 04:18:14 PM (9 years ago)
Author:
ryan
Message:

More screen reader text for list table checkboxes and theme install search. Props MikeLittle, SergeyBiryukov. see #21325

Location:
trunk/wp-admin/includes
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-comments-list-table.php

    r21317 r21323  
    318318
    319319    function column_cb( $comment ) {
    320         if ( $this->user_can ) {
    321             echo '<label class="screen-reader-text" for="cb-select-' . $comment->comment_ID . '">' . __( 'Select comment' )
    322                 . "</label><input id='cb-select-$comment->comment_ID' type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
     320        if ( $this->user_can ) { ?>
     321        <label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label>
     322        <input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" />
     323        <?php
    323324        }
    324325    }
  • trunk/wp-admin/includes/class-wp-links-list-table.php

    r21317 r21323  
    129129
    130130                switch ( $column_name ) {
    131                     case 'cb':
    132                         echo '<th scope="row" class="check-column"><label for="cb-select-' . $link->link_id . '" class="screen-reader-text">' . sprintf( __( 'Select %s' ), $link->link_name )
    133                                 . '</label><input type="checkbox" name="linkcheck[]" id="cb-select-' . $link->link_id . '" value="'. esc_attr( $link->link_id ) .'" /></th>';
     131                    case 'cb': ?>
     132                        <th scope="row" class="check-column">
     133                            <label class="screen-reader-text" for="cb-select-<?php echo $link->link_id; ?>"><?php echo sprintf( __( 'Select %s' ), $link->link_name ); ?></label>
     134                            <input type="checkbox" name="linkcheck[]" id="cb-select-<?php echo $link->link_id; ?>" value="<?php echo esc_attr( $link->link_id ); ?>" />
     135                        </th>
     136                        <?php
    134137                        break;
    135138
  • trunk/wp-admin/includes/class-wp-list-table.php

    r21317 r21323  
    667667        if ( ! empty( $columns['cb'] ) ) {
    668668            static $cb_counter = 1;
    669             $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' )
    670                 . '</label><input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
     669            $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
     670                . '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
    671671            $cb_counter++;
    672672        }
  • trunk/wp-admin/includes/class-wp-media-list-table.php

    r21317 r21323  
    192192        <th scope="row" class="check-column">
    193193            <?php if ( $user_can_edit ) { ?>
    194                 <label for="cb-select-<?php the_ID(); ?>" class="screen-reader-text"><?php echo sprintf( __( 'Select %s' ), $att_title );?></label>
     194                <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php echo sprintf( __( 'Select %s' ), $att_title );?></label>
    195195                <input type="checkbox" name="media[]" id="cb-select-<?php the_ID(); ?>" value="<?php the_ID(); ?>" />
    196196            <?php } ?>
  • trunk/wp-admin/includes/class-wp-ms-sites-list-table.php

    r19712 r21323  
    214214                    case 'cb': ?>
    215215                        <th scope="row" class="check-column">
     216                            <label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>"><?php printf( __( 'Select %s' ), $blogname ); ?></label>
    216217                            <input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
    217218                        </th>
  • trunk/wp-admin/includes/class-wp-ms-users-list-table.php

    r19712 r21323  
    166166                    case 'cb': ?>
    167167                        <th scope="row" class="check-column">
     168                            <label class="screen-reader-text" for="blog_<?php echo $user->ID; ?>"><?php echo sprintf( __( 'Select %s' ), $user->user_login ); ?></label>
    168169                            <input type="checkbox" id="blog_<?php echo $user->ID ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ) ?>" />
    169170                        </th>
  • trunk/wp-admin/includes/class-wp-plugins-list-table.php

    r21198 r21323  
    372372        $class = $is_active ? 'active' : 'inactive';
    373373        $checkbox_id =  "checkbox_" . md5($plugin_data['Name']);
    374         $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>";
     374        if ( in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
     375            $checkbox = '';
     376        } else {
     377            $checkbox = "<label class='screen-reader-text' for='" . $checkbox_id . "' >" . sprintf( __( 'Select %s' ), $plugin_data['Name'] ) . "</label>"
     378                . "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' />";
     379        }
    375380        if ( 'dropins' != $context ) {
    376381            $description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : '&nbsp;' ) . '</p>';
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r21317 r21323  
    493493            case 'cb':
    494494            ?>
    495             <th scope="row" class="check-column"><?php if ( $can_edit_post ) { ?>
    496             <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title );
    497             ?></label><input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
    498             <?php } ?></th>
     495            <th scope="row" class="check-column">
     496                <?php if ( $can_edit_post ) { ?>
     497                <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label>
     498                <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
     499                <?php } ?>
     500            </th>
    499501            <?php
    500502            break;
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r21317 r21323  
    237237
    238238        if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
    239             return '<label for="cb-select-' . $tag->term_id . '" class="screen-reader-text">' . sprintf( __( 'Select %s' ), $tag->name )
    240                 . '</label><input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
     239            return '<label class="screen-reader-text" for="cb-select-' . $tag->term_id . '">' . sprintf( __( 'Select %s' ), $tag->name ) . '</label>'
     240                . '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
    241241
    242242        return '&nbsp;';
  • trunk/wp-admin/includes/class-wp-users-list-table.php

    r21317 r21323  
    257257
    258258            // Set up the checkbox ( because the user is editable, otherwise its empty )
    259             $checkbox = '<label for="cb-select-' . $user_object->ID . '" class="screen-reader-text">' . sprintf( __( 'Select %s' ), $user_object->user_login )
    260                         . "</label><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
     259            $checkbox = '<label class="screen-reader-text" for="cb-select-' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>'
     260                        . "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
    261261
    262262        } else {
  • trunk/wp-admin/includes/theme-install.php

    r21318 r21323  
    5959    <input type="hidden" name="tab" value="search" />
    6060    <?php if ( $type_selector ) : ?>
    61     <label class="screen-reader-text" for="typeselector"><?php _e("Type of search"); ?></label>
     61    <label class="screen-reader-text" for="typeselector"><?php _e('Type of search'); ?></label>
    6262    <select name="type" id="typeselector">
    6363    <option value="term" <?php selected('term', $type) ?>><?php _e('Keyword'); ?></option>
     
    6565    <option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
    6666    </select>
    67     <label class="screen-reader-text" for="s"><?php printf( __("Search by %s"), ( $type == 'term' ? __( 'keyword' ) : $type ) ); ?></label>
     67    <label class="screen-reader-text" for="s"><?php
     68    switch ( $type ) {
     69        case 'term':
     70            _e( 'Search by keyword' );
     71            break;
     72        case 'author':
     73            _e( 'Search by author' );
     74            break;
     75        case 'tag':
     76            _e( 'Search by tag' );
     77            break;
     78    }
     79    ?></label>
    6880    <?php else : ?>
    69     <label class="screen-reader-text" for="s"><?php _e("Search by keyword"); ?></label>
     81    <label class="screen-reader-text" for="s"><?php _e('Search by keyword'); ?></label>
    7082    <?php endif; ?>
    7183    <input type="search" name="s" id="s" size="30" value="<?php echo esc_attr($term) ?>" autofocus="autofocus" />
Note: See TracChangeset for help on using the changeset viewer.