#56067 closed defect (bug) (fixed)
Hide query loop pagination link arrows from assistive technology
Reported by: | afercia | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Editor | Keywords: | has-patch commit needs-dev-note |
Focuses: | accessibility | Cc: |
Description
The Query Loop block and the Comments Query Loop block include pagination links. The 'next' and 'previous' links within the pagination can optionally display arrows or chevron characters.
These characters are just text. As such, they're read out by assistive technologies. For better accessibility, it's best to reduce noise for screen reader users and hide the arrows/chevrons by the means of an aria-hidden="true"
attribute.
Right now, these links are read out this way:
Next Page right arrow left arrow Previous Page
For the Comments pagination, that would be:
Newer Comments right arrow left arrow Older Comments
The HTML output can be inspected on the Twenty Twenty-Two theme. Example:
<span class="wp-block-query-pagination-next-arrow is-arrow-arrow">→</span>
Worth nothing that in the previous bundled themes, care has been taken to make sure these arrows are hidden from assistive technologies. For example:
In Twenty Twenty, it's hidden by the means of an aria-hidden attribute:
<span aria-hidden="true">→</span>
In Twenty Twenty-One, the arrow is an SVG icon with an aria-hidden attribute:
<svg ... aria-hidden="true" role="img" focusable="false" ...
The functions that need to be changed are now in core in the file src/wp-includes/blocks.php
. See:
get_query_pagination_arrow()
get_comments_pagination_arrow()
Attachments (5)
Change History (26)
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
2 years ago
#3
@
2 years ago
- Keywords has-patch added; good-first-bug needs-patch removed
Well, I have applied those missing attributes and patch is uploaded.
This ticket was mentioned in Slack in #core by kamig478. View the logs.
2 years ago
#5
@
2 years ago
@kamig478 Thank you for contributing! Your diff updates the function get_query_pagination_arrow
three times, but other than that it looks good to me. I don't have any assistive software to test so I'm going to defer to @afercia and @joedolson
#6
@
2 years ago
Thanks for the update. Could you re-create attribute-added.56067-3.diff with tabs to indent the lines instead of spaces?
#7
@
2 years ago
@afercia @sabernhardt @zieladam @joedolson I have intended the code with tabs rather than spaces and here is the diff file URL https://core.trac.wordpress.org/attachment/ticket/56067/attribute-added.56067-4.diff
Thank You
This ticket was mentioned in Slack in #accessibility by kamig478. View the logs.
2 years ago
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
2 years ago
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
2 years ago
#12
@
2 years ago
- Keywords commit added
As mentioned in the bug scrub, the patch needed to be refreshed to ensure that tabs were used for indentation. While attempting to apply the patch to do this, I received "patch: malformed patch".
I've refreshed the patch to indent with tabs (Trac shows spaces, but you can apply the patch to see the tabs), and the refresh also resolves the malformed patch issue.
Marking for commit
per the bug scrub discussion.
Additional props: @ryokuhi, @sabernhardt
This ticket was mentioned in Slack in #accessibility by kamig478. View the logs.
2 years ago
#14
@
2 years ago
- Owner set to audrasjb
- Status changed from new to reviewing
Self assigning for final review.
This ticket was mentioned in PR #3233 on WordPress/wordpress-develop by audrasjb.
2 years ago
#15
Trac ticket: https://core.trac.wordpress.org/ticket/56067
2 years ago
#18
Committed in https://core.trac.wordpress.org/changeset/54138
#19
@
2 years ago
- Keywords needs-dev-note added
Can go into grouped dev note "Accessibility improvements"
I have fixed the issue and added those missing attributes