[wp-trac] [WordPress Trac] #63973: Add Media Button missing aria-haspopup and aria-controls
WordPress Trac
noreply at wordpress.org
Mon Sep 15 04:24:42 UTC 2025
#63973: Add Media Button missing aria-haspopup and aria-controls
---------------------------+-----------------------------
Reporter: alh0319 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: TinyMCE | Version:
Severity: normal | Keywords:
Focuses: accessibility |
---------------------------+-----------------------------
In the classic editor, above the TinyMCE editor, there is an "Add Media"
button which, when clicked, triggers the media library to open in a
dialog.
This is the current code for that button:
{{{
<button type="button" id="insert-media-button" class="button insert-media
add_media" data-editor="content"><span class="wp-media-buttons-
icon"></span> Add Media</button>
}}}
Screen reader users are not warned that triggering this button will open a
modal dialog.
For WCAG conformance the following attributes need to be added to this
button:
* aria-haspopup="dialog"
* aria-controls referncing the ID of the modal being opened
For additional information see:
* [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/63973>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list