From 1a03159d26f316ea14cf48394cc8f6cbeec50e78 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 6 Mar 2018 17:20:07 +0000 Subject: [PATCH] Accessibility: Make the Widgets screen "Enable accessibility mode" link more discoverable. For a number of years, the link to the Widgets screen "Accessibility mode" lived in the Screen Options panel, hidden by default. Many users, including assistive technologies users, weren't able to find it or even aware it existed. By bringing the link in the main screen, visible by default, this change makes the "Accessibility mode" easily discoverable for everyone. Props chetan200891, antonioeatgoat. Fixes #42778. git-svn-id: https://develop.svn.wordpress.org/trunk@42790 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/widgets.css | 10 ++++++++++ src/wp-admin/includes/class-wp-screen.php | 21 +++++++-------------- src/wp-admin/widgets.php | 5 +++++ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/wp-admin/css/widgets.css b/src/wp-admin/css/widgets.css index a4d314ab80..8cdd87f5a8 100644 --- a/src/wp-admin/css/widgets.css +++ b/src/wp-admin/css/widgets.css @@ -495,6 +495,11 @@ div#widgets-right .closed .widgets-sortables { } /* Accessibility Mode */ +.widget-access-link { + float: right; + margin: -5px 0 10px 10px; +} + .widgets_access #widgets-left .widget .widget-top { cursor: auto; } @@ -793,6 +798,11 @@ ul.CodeMirror-hints { margin: 0 auto !important; max-width: 480px; } + + .widget-access-link { + float: none; + margin: 15px 0 0 0; + } } @media screen and (max-width: 320px) { diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index 6133f923c0..d4b5a9c92f 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -918,20 +918,13 @@ if ( $this->show_screen_options() ) : $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' ); - switch ( $this->base ) { - case 'widgets': - $nonce = wp_create_nonce( 'widgets-access' ); - $this->_screen_settings = '

' . __( 'Enable accessibility mode' ) . '' . __( 'Disable accessibility mode' ) . "

\n"; - break; - case 'post': - $expand = ''; - $this->_screen_settings = $expand; - break; - default: - $this->_screen_settings = ''; - break; + $this->_screen_settings = ''; + + if ( 'post' === $this->base ) { + $expand = ''; + $this->_screen_settings = $expand; } /** diff --git a/src/wp-admin/widgets.php b/src/wp-admin/widgets.php index 7d12a27d6a..ade4fd2b4b 100644 --- a/src/wp-admin/widgets.php +++ b/src/wp-admin/widgets.php @@ -399,7 +399,12 @@ if ( current_user_can( 'customize' ) ) { __( 'Manage with Live Preview' ) ); } + +$nonce = wp_create_nonce( 'widgets-access' ); ?> +