Ticket #21325: 21325.2.diff

File 21325.2.diff, 3.1 KB (added by nacin, 10 months ago)
Line 
1Index: wp-admin/includes/class-wp-posts-list-table.php
2===================================================================
3--- wp-admin/includes/class-wp-posts-list-table.php     (revision 21256)
4+++ wp-admin/includes/class-wp-posts-list-table.php     (working copy)
5@@ -492,7 +492,10 @@
6 
7                        case 'cb':
8                        ?>
9-                       <th scope="row" class="check-column"><?php if ( $can_edit_post ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>
10+                       <th scope="row" class="check-column"><?php if ( $can_edit_post ) { ?>
11+                       <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title );
12+                       ?></label><input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
13+                       <?php } ?></th>
14                        <?php
15                        break;
16 
17Index: wp-admin/includes/class-wp-terms-list-table.php
18===================================================================
19--- wp-admin/includes/class-wp-terms-list-table.php     (revision 21256)
20+++ wp-admin/includes/class-wp-terms-list-table.php     (working copy)
21@@ -236,9 +236,10 @@
22                $default_term = get_option( 'default_' . $taxonomy );
23 
24                if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
25-                       return '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" />';
26-               else
27-                       return '&nbsp;';
28+                       return '<label for="cb-select-' . $tag->term_id . '" class="screen-reader-text">' . sprintf( __( 'Select %s' ), $tag->name )
29+                               . '</label><input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" id="cb-select-' . $tag->term_id . '" />';
30+
31+               return '&nbsp;';
32        }
33 
34        function column_name( $tag ) {
35Index: wp-admin/includes/class-wp-list-table.php
36===================================================================
37--- wp-admin/includes/class-wp-list-table.php   (revision 21256)
38+++ wp-admin/includes/class-wp-list-table.php   (working copy)
39@@ -664,6 +664,13 @@
40                else
41                        $current_order = 'asc';
42 
43+               if ( ! empty( $columns['cb'] ) ) {
44+                       static $cb_counter = 1;
45+                       $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' )
46+                               . '</label><input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
47+                       $cb_counter++;
48+               }
49+
50                foreach ( $columns as $column_key => $column_display_name ) {
51                        $class = array( 'manage-column', "column-$column_key" );
52 
53Index: wp-admin/includes/class-wp-comments-list-table.php
54===================================================================
55--- wp-admin/includes/class-wp-comments-list-table.php  (revision 21256)
56+++ wp-admin/includes/class-wp-comments-list-table.php  (working copy)
57@@ -317,8 +317,10 @@
58        }
59 
60        function column_cb( $comment ) {
61-               if ( $this->user_can )
62-                       echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
63+               if ( $this->user_can ) {
64+                       echo '<label class="screen-reader-text" for="cb-select-' . $comment->comment_ID . '">' . __( 'Select comment' )
65+                               . "</label><input id='cb-select-$comment->comment_ID' type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
66+               }
67        }
68 
69        function column_comment( $comment ) {