Make WordPress Core

Changeset 59859


Ignore:
Timestamp:
02/22/2025 12:10:50 PM (2 weeks ago)
Author:
audrasjb
Message:

Site Health: Improve HTML semantics for tables used in Site Health debug tab.

This changeset removes the presentation role from the Site Health debug tab tables to switch them into regular data tables, and updates the related stylesheet to keep the previously used styles.

Props audrasjb, hbhalodia, rvouill, mukesh27, sabernhardt, joedolson, alexstine.
Fixes #62880.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/site-health.css

    r57270 r59859  
    167167}
    168168
     169.widefat.health-check-table th {
     170    font-size: 13px;
     171}
     172
    169173.health-check-table td:first-child {
    170174    width: 30%;
     
    338342    }
    339343
     344    .health-check-table th,
    340345    .health-check-table td {
    341346        box-sizing: border-box;
     
    345350    }
    346351
     352    .widefat.health-check-table th,
    347353    .health-check-table td:first-child {
    348354        width: 100%;
  • trunk/src/wp-admin/site-health-info.php

    r58299 r59859  
    109109
    110110                ?>
    111                 <table class="widefat striped health-check-table" role="presentation">
     111                <table class="widefat striped health-check-table">
    112112                    <tbody>
    113113                    <?php
     
    127127
    128128                        if ( in_array( $field_name, $sizes_fields, true ) ) {
    129                             printf( '<tr><td>%s</td><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );
     129                            printf( '<tr><th scope="row">%s</th><td class="%s">%s</td></tr>', esc_html( $field['label'] ), esc_attr( $field_name ), $values );
    130130                        } else {
    131                             printf( '<tr><td>%s</td><td>%s</td></tr>', esc_html( $field['label'] ), $values );
     131                            printf( '<tr><th scope="row">%s</th><td>%s</td></tr>', esc_html( $field['label'] ), $values );
    132132                        }
    133133                    }
Note: See TracChangeset for help on using the changeset viewer.