mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-24 15:24:36 +00:00
Accessibility: Improve the File Editors interstitial warning.
The warning displayed upon first visit on the File Editors introduced in [41774] needs to be the only perceivable content in the page for users of assistive technologies. It looks like a modal but it's not exactly an ARIA dialog, not an ARIA alert either, and needs some special treatment. - constrains tabbing within the modal - uses `wp.a11y.speak()` to make screen readers announce the modal message - hides all the other page content from assistive technologies using `aria-hidden="true"` This way, even if users miss the speak message, the warning is actually the only perceivable content in the page. Fixes #42110. git-svn-id: https://develop.svn.wordpress.org/trunk@41876 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -297,21 +297,23 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
|
||||
$return_url = admin_url( '/' );
|
||||
}
|
||||
?>
|
||||
<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js">
|
||||
<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden">
|
||||
<div class="notification-dialog-background"></div>
|
||||
<div class="notification-dialog" role="dialog" aria-labelledby="file-editor-warning-title" tabindex="0">
|
||||
<div class="notification-dialog">
|
||||
<div class="file-editor-warning-content">
|
||||
<h1 id="file-editor-warning-title"><?php _e( 'Heads up!' ); ?></h1>
|
||||
<p>
|
||||
<?php
|
||||
echo sprintf(
|
||||
/* translators: %s is a link to Custom CSS section in the Customizer. */
|
||||
__( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don’t! Editing this code directly is dangerous, and can leave you unable to log back in to WordPress and undo changes. There’s no need to change your CSS here — you can edit and live preview CSS changes in WordPress’s <a href="%s">built in CSS editor</a>.' ),
|
||||
esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p><?php _e( 'If you decide to go ahead with direct edits anyway, make sure to back up all your site’s files before making changes so you can restore a functional version if something goes wrong.' ); ?></p>
|
||||
<div class="file-editor-warning-message">
|
||||
<h1><?php _e( 'Heads up!' ); ?></h1>
|
||||
<p>
|
||||
<?php
|
||||
echo sprintf(
|
||||
/* translators: %s is a link to Custom CSS section in the Customizer. */
|
||||
__( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don’t! Editing this code directly is dangerous, and can leave you unable to log back in to WordPress and undo changes. There’s no need to change your CSS here — you can edit and live preview CSS changes in WordPress’s <a href="%s">built in CSS editor</a>.' ),
|
||||
esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p><?php _e( 'If you decide to go ahead with direct edits anyway, make sure to back up all your site’s files before making changes so you can restore a functional version if something goes wrong.' ); ?></p>
|
||||
</div>
|
||||
<p>
|
||||
<a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a>
|
||||
<button type="button" class="file-editor-warning-dismiss button button-primary"><?php _e( 'I understand' ); ?></button>
|
||||
|
||||
Reference in New Issue
Block a user