A11y: Add spoken notice when screen options are saved on change.
When some screen option input fields are changed (post table columns, welcome panel, and metabox visibility), the change is saved to options. Other screen options (e.g. number of items per page) are only saved on submit. The changes that are saved immediately are visibly changed for sighted readers immediately. Change adds a `wp.a11y.speak()` call to inform screen readers that a value change has updated screen options. Props kkmuffme, joedolson, yogeshbhutkar, audrasjb, sourabhjain. Fixes #62550. Built from https://develop.svn.wordpress.org/trunk@59988 git-svn-id: http://core.svn.wordpress.org/trunk@59330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -419,12 +419,18 @@ window.columns = {
|
||||
*/
|
||||
saveManageColumnsState : function() {
|
||||
var hidden = this.hidden();
|
||||
$.post(ajaxurl, {
|
||||
action: 'hidden-columns',
|
||||
hidden: hidden,
|
||||
screenoptionnonce: $('#screenoptionnonce').val(),
|
||||
page: pagenow
|
||||
});
|
||||
$.post(
|
||||
ajaxurl,
|
||||
{
|
||||
action: 'hidden-columns',
|
||||
hidden: hidden,
|
||||
screenoptionnonce: $('#screenoptionnonce').val(),
|
||||
page: pagenow
|
||||
},
|
||||
function() {
|
||||
wp.a11y.speak( __( 'Screen Options updated.' ) );
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
2
wp-admin/js/common.min.js
vendored
2
wp-admin/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -27,11 +27,17 @@ jQuery( function($) {
|
||||
* @return {void}
|
||||
*/
|
||||
updateWelcomePanel = function( visible ) {
|
||||
$.post( ajaxurl, {
|
||||
action: 'update-welcome-panel',
|
||||
visible: visible,
|
||||
welcomepanelnonce: $( '#welcomepanelnonce' ).val()
|
||||
});
|
||||
$.post(
|
||||
ajaxurl,
|
||||
{
|
||||
action: 'update-welcome-panel',
|
||||
visible: visible,
|
||||
welcomepanelnonce: $( '#welcomepanelnonce' ).val()
|
||||
},
|
||||
function() {
|
||||
wp.a11y.speak( wp.i18n.__( 'Screen Options updated.' ) );
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// Unhide the welcome panel if the Welcome Option checkbox is checked.
|
||||
|
||||
2
wp-admin/js/dashboard.min.js
vendored
2
wp-admin/js/dashboard.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -461,13 +461,19 @@
|
||||
closed = $( '.postbox' ).filter( '.closed' ).map( function() { return this.id; } ).get().join( ',' );
|
||||
hidden = $( '.postbox' ).filter( ':hidden' ).map( function() { return this.id; } ).get().join( ',' );
|
||||
|
||||
$.post(ajaxurl, {
|
||||
action: 'closed-postboxes',
|
||||
closed: closed,
|
||||
hidden: hidden,
|
||||
closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
|
||||
page: page
|
||||
});
|
||||
$.post(
|
||||
ajaxurl,
|
||||
{
|
||||
action: 'closed-postboxes',
|
||||
closed: closed,
|
||||
hidden: hidden,
|
||||
closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
|
||||
page: page
|
||||
},
|
||||
function() {
|
||||
wp.a11y.speak( __( 'Screen Options updated.' ) );
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
2
wp-admin/js/postbox.min.js
vendored
2
wp-admin/js/postbox.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-beta2-59987';
|
||||
$wp_version = '6.8-beta2-59988';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user