Skip to content

Commit

Permalink
Comments: Announce reply notices to screen reader users.
Browse files Browse the repository at this point in the history
Improve experience for screen reader users by calling `wp.a11y.speak()` with the results of comment reply submissions within the WordPress dashboard.

Props joedolson, khokansardar.
Fixes #61480.


git-svn-id: https://develop.svn.wordpress.org/trunk@58931 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
peterwilsoncc committed Aug 25, 2024
1 parent c353d8b commit 0687800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/js/_enqueues/admin/edit-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,7 @@ window.commentReply = {
if ( er ) {
$errorNotice.removeClass( 'hidden' );
$error.html( er );
wp.a11y.speak( er );
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ function wp_default_scripts( $scripts ) {
$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 );
$scripts->set_translations( 'admin-tags' );

$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array( 'wp-lists', 'quicktags', 'jquery-query' ), false, 1 );
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array( 'wp-lists', 'quicktags', 'jquery-query', 'wp-a11y' ), false, 1 );
$scripts->set_translations( 'admin-comments' );
did_action( 'init' ) && $scripts->localize(
'admin-comments',
Expand Down

0 comments on commit 0687800

Please sign in to comment.