Skip to content

List Table: Fix incorrect use of row headers in post list tables - #9761

Closed
himanshupathak95 wants to merge 11 commits into
WordPress:trunkfrom
himanshupathak95:fix/32892
Closed

List Table: Fix incorrect use of row headers in post list tables#9761
himanshupathak95 wants to merge 11 commits into
WordPress:trunkfrom
himanshupathak95:fix/32892

Conversation

@himanshupathak95

@himanshupathak95 himanshupathak95 commented Sep 5, 2025

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/32892

Changes the semantic structure so that:

  • Checkbox columns use <td> instead of <th scope="row">
  • Primary content columns (like post titles) use <th scope="row"> as proper row headers

This ensures screen readers announce meaningful content (post titles, usernames, etc.) as row headers instead of "Select [item]" from checkboxes.

  • Centralized aria-label Handling: Added a get_primary_column_aria_label() hook directly in WP_List_Table so the parent class is responsible for attaching aria-label to primary column row headers rather than delegating to subclasses.
  • Removed "Title and Title" Duplication: Overrode the method in WP_Posts_List_Table, WP_Plugins_List_Table, WP_Users_List_Table, and WP_MS_Themes_List_Table to return each item's clean, human-readable identifier. This resolves the screen-reader duplication caused by the row header's accessible name being computed from full cell content (including row actions and excerpt).
  • Cleanup: Removed the unused abbr attribute as flagged by reviewers.
  • CSS Consistency: Updated CSS across common.css, list-tables.css, and forms.css to add td.check-column selectors alongside the existing th.check-column rules, and extended responsive column-primary sibling selectors to cover the <th> case.

@himanshupathak95

Copy link
Copy Markdown
Author

Other list tables, such as the Users list and multi-site tables, are yet to be updated. Additionally, the styling has been affected, which I will address in the subsequent commits.

@github-actions

github-actions Bot commented Sep 5, 2025

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@himanshupathak95

Copy link
Copy Markdown
Author

The styles of the plugins list table and highly coupled, and removing padding on unselected rows is affecting other headers. Debugging deeper into this -

Screen.Recording.2025-09-09.at.15.23.37.mov

@himanshupathak95
himanshupathak95 marked this pull request as ready for review July 8, 2026 11:58
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props abcd95, joedolson.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI review requested due to automatic review settings July 23, 2026 16:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Considered using the post excerpt, as added elsewhere, but it doesn't return a value in excerpt mode for the view
Copilot AI review requested due to automatic review settings July 23, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

pento pushed a commit that referenced this pull request Jul 23, 2026
The `select` column has been the `th` with row scope for post list tables since at least 2010. This results in a row name for screen readers that is based on the checkbox input and its label, which can be an empty value when that input is not available.

Move the `th` to the post title column, change the select column to `td`, and add `aria-label` to the `th` to provide a simplified row name to supporting screen readers.

Styles are additive, to retain support for custom list table implementations.

Developed in #9761

Props afercia, abcd95, ozgursar, nikunj8866, joedolson.
Fixes #32892.

git-svn-id: https://develop.svn.wordpress.org/trunk@62838 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 62838
GitHub commit: 0029901

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Jul 23, 2026
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Jul 23, 2026
The `select` column has been the `th` with row scope for post list tables since at least 2010. This results in a row name for screen readers that is based on the checkbox input and its label, which can be an empty value when that input is not available.

Move the `th` to the post title column, change the select column to `td`, and add `aria-label` to the `th` to provide a simplified row name to supporting screen readers.

Styles are additive, to retain support for custom list table implementations.

Developed in WordPress/wordpress-develop#9761

Props afercia, abcd95, ozgursar, nikunj8866, joedolson.
Fixes #32892.
Built from https://develop.svn.wordpress.org/trunk@62838


git-svn-id: http://core.svn.wordpress.org/trunk@62118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants