[wp-trac] [WordPress Trac] #63980: Set featured image button incorrectly coded as link and missing required ARIA attributes
WordPress Trac
noreply at wordpress.org
Mon Sep 15 14:04:58 UTC 2025
#63980: Set featured image button incorrectly coded as link and missing required
ARIA attributes
-------------------------------+-----------------------------
Reporter: alh0319 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version:
Severity: normal | Keywords:
Focuses: ui, accessibility |
-------------------------------+-----------------------------
In the classic editor, there is a link that opens the Media Library in a
modal so users can select the featured image. This is the link:
{{{
<a href="https://wooclassic.instawp.xyz/wp-admin/media-
upload.php?post_id=229&type=image&TB_iframe=1&width=753&height=847"
id="set-post-thumbnail" class="thickbox">Set featured image</a>
}}}
Links take people to another page or another part of the same page.
Buttons trigger behaviors on a page such as opening a modal. This element
is incorrectly coded as a link and should be a button instead.
Additionally, screen reader users are not warned that triggering this
button will open a modal dialog.
For WCAG conformance, the following changes need to be made:
* Recode the button using a proper `<button>` tag or add `role="button"`
to the link (if adding `role="button"` JavaScript must also be added that
allows it to be triggered with the spacebar.
* Add `aria-haspopup="dialog"`
* Add the `aria-controls` attribute referencing the ID of the modal being
opened.
For additional information see:
* [https://developer.mozilla.org/en-
US/docs/Web/Accessibility/ARIA/Reference/Roles/button_role MDN button
role]
* [https://developer.mozilla.org/en-
US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-haspopup MDN
ARIA: aria-haspopup attribute]
* [https://developer.mozilla.org/en-
US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-controls MDN
ARIA: aria-controls attribute]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63980>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list