Make WordPress Core

Timestamp:
06/21/2024 06:15:50 PM (5 weeks ago)
Author:
joedolson
Message:

Administration: A11y: Add role="alert" on JS injected admin notices.

Add the attribute role="alert" on 12 instances of admin notices that are injected into the DOM using JavaScript. The role="alert" attribute allows screen readers to recognize the addition to the DOM and announce the errors to users.

Props afercia, cyrus11, rcreators, joedolson.
Fixes #47111.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/widgets/media.js

    r51701 r58455  
    159159                        } else {
    160160                            if ( ! noticeContainer.length ) {
    161                                 noticeContainer = $( '<div class="media-widget-embed-notice notice notice-error notice-alt"></div>' );
     161                                noticeContainer = $( '<div class="media-widget-embed-notice notice notice-error notice-alt"></div>' );
    162162                                noticeContainer.hide();
    163163                                embedLinkView.views.parent.$el.prepend( noticeContainer );
Note: See TracChangeset for help on using the changeset viewer.