Skip to content

Conversation

@Adi-ty
Copy link
Contributor

@Adi-ty Adi-ty commented Jul 15, 2025

What?

Closes #70729

This PR updates the Comments Pagination block to use a <nav> element with aria-label="Comments pagination" as its wrapper, instead of a <div>

Why?

  • Improves accessibility by providing a navigation landmark
  • Aligns the block’s markup with the core the_comments_pagination() function and the Query Pagination block.

How?

  • Changes the render function to output with aria-label="Comments pagination" and the appropriate classes.
  • Uses get_block_wrapper_attributes() to add the aria-label and class attributes.

Testing Instructions

  1. Add a Comments Pagination block to a post or template.
  2. View the front end and inspect the markup.
  3. Confirm the pagination is wrapped in a <nav> element with aria-label="Comments pagination".

@Adi-ty Adi-ty marked this pull request as ready for review July 15, 2025 11:39
@github-actions
Copy link

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Adi-ty <[email protected]>
Co-authored-by: t-hamano <[email protected]>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Block] Comments Pagination Affects the Comments Pagination Block labels Jul 16, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the quick fix.

P.S. I recommend that you don't omit the Testing Instructions section. Without this section, reviewers may not know what to test and how to test it.

@t-hamano t-hamano merged commit 20fd653 into WordPress:trunk Jul 16, 2025
75 of 76 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.3 milestone Jul 16, 2025
@Adi-ty
Copy link
Contributor Author

Adi-ty commented Jul 16, 2025

Thanks @t-hamano, I've just added the Testing Instructions and will keep that in mind for next time.

USERSATOSHI pushed a commit to USERSATOSHI/gutenberg that referenced this pull request Jul 23, 2025
* fix: use <nav> with aria-label for Comments Pagination block for accessibility

Fixes WordPress#70729

* fix: update aria-label for Comments Pagination block to improve accessibility

Co-authored-by: Adi-ty <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Comments Pagination Affects the Comments Pagination Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility improvements to the Comments Pagination block

2 participants