Skip to content

Fix: Add unique accessible names to post-date and Comments CTA links - #54

Open
ikamal7 wants to merge 1 commit into
WordPress:trunkfrom
ikamal7:fix/issue-47-ambiguous-link-text
Open

ikamal7 wants to merge 1 commit into
WordPress:trunkfrom
ikamal7:fix/issue-47-ambiguous-link-text

Conversation

@ikamal7

@ikamal7 ikamal7 commented Sep 17, 2026

Copy link
Copy Markdown

Description

Resolves ambiguous link text accessibility issues where multiple posts share the same accessible name:

  1. Post date links — Multiple posts published on the same day announced identical names to screen readers. Added a filter that appends the post title to an on the linked date.

  2. Comments CTA links — The "Join the conversation" / "Be the first to comment" links repeated the same text across posts. The block binding callback now includes the post title in an .

Both fixes follow the pattern: , making each link uniquely identifiable.

Fixes #47

@github-actions

github-actions Bot commented Sep 17, 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.

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: ikamal7 <ikamal@git.wordpress.org>
Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: henriqueiamarino <iamarinoh@git.wordpress.org>

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

@github-actions github-actions Bot added First-time Contributor Pull request opened by a first-time contributor to the repository [Area] Patterns Issues or PRs that touch the theme's block patterns. labels Sep 17, 2026
@github-actions

Copy link
Copy Markdown

👋 Thanks for your first pull request, @ikamal7! We'll take a look soon.

@github-actions github-actions Bot added the [Area] Theme Functions Issues or PRs that touch functions.php. label Sep 17, 2026
Adds aria-label attributes that include the post title to both the
linked post-date and the Comments CTA links, so each link announces
a unique accessible name to screen readers. Fixes WordPress#47
@ikamal7
ikamal7 force-pushed the fix/issue-47-ambiguous-link-text branch from f09a924 to adab85b Compare September 17, 2026 16:42
@github-actions github-actions Bot removed the [Area] Patterns Issues or PRs that touch the theme's block patterns. label Sep 17, 2026
@carolinan

Copy link
Copy Markdown
Contributor

I'm not a native English speaker, but I don't think adding a colon between the data is helpful.
Example:
2016-04-15: Hello world
Join the conversation: Hello world

I would personally prefer if the link on the date was just removed. I don't think each post needs four to five links:
featured image
post title
date
comment link 1
comment link 2

Please allow more contributors to chime in before making more changes.

Comment thread functions.php
$post_title
);

return str_replace(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think a theme should take into its hands this kind of DOM manipulation. Something like this should be done in core if it was really needed, else every theme would need this code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can agree, on the other hand, users can solve this without a change in Gutenberg, by removing the link from the date or by selecting a format that is unique, not only the year, month and day.

@MaggieCabrera

Copy link
Copy Markdown
Contributor

I would personally prefer if the link on the date was just removed. I don't think each post needs four to five links: featured image post title date comment link 1 comment link 2

Agree, I think that's what the PR should be

@henriqueiamarino

Copy link
Copy Markdown
Contributor

I don't mind removing the date links—fine by me from the design side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Theme Functions Issues or PRs that touch functions.php. First-time Contributor Pull request opened by a first-time contributor to the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambiguous link texts found

4 participants