Make WordPress Core


Ignore:
Timestamp:
06/21/2023 01:52:16 AM (16 months ago)
Author:
joedolson
Message:

Administration: Make checkbox column clickable.

Change the label for .check-column inside list tables to a block filling the entire cell. Improves accessibility by increasing the target area for the control.

Props mitchoyoshitaka, lessbloat, sabernhardt, ogleker, tacoverdo, joostdevalk, karmatosed.

Fixes #21516.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php

    r55911 r55954  
    416416     */
    417417    public function column_cb( $item ) {
    418         return sprintf( '<input type="checkbox" name="request_id[]" value="%1$s" /><span class="spinner"></span>', esc_attr( $item->ID ) );
     418        return sprintf(
     419            '<label class="label-covers-full-cell" for="requester_%1$s"><span class="screen-reader-text">%2$s</span></label>' .
     420            '<input type="checkbox" name="request_id[]" id="requester_%1$s" value="%1$s" /><span class="spinner"></span>',
     421            esc_attr( $item->ID ),
     422            /* translators: Hidden accessibility text. %s: Email address. */
     423            sprintf( __( 'Select %s' ), $item->email )
     424        );
    419425    }
    420426
Note: See TracChangeset for help on using the changeset viewer.