From 04fbf4cd6023b631808806d2597040af62e62196 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 3 Apr 2015 01:54:47 +0000 Subject: [PATCH] Accessibility improvements for Options general screen: add missing labels and aria attributes. Props DrewAPicture, afercia. Fixes #31144. git-svn-id: https://develop.svn.wordpress.org/trunk@31993 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/forms.css | 7 ++++++- src/wp-admin/options-general.php | 34 +++++++++++++++++--------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css index 9987f75249..68aeccc99e 100644 --- a/src/wp-admin/css/forms.css +++ b/src/wp-admin/css/forms.css @@ -811,9 +811,14 @@ table.form-table td .updated p { vertical-align: middle; } +.options-general-php input.small-text { + width: 56px; +} + .options-general-php .spinner { float: none; - margin: -3px 3px; + margin: 0 3px; + vertical-align: text-bottom; } .settings-php .language-install-spinner, diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php index 15bfaaa021..5055e5f04f 100644 --- a/src/wp-admin/options-general.php +++ b/src/wp-admin/options-general.php @@ -45,7 +45,7 @@ function options_general_add_js() { $("input[name='date_format']").click(function(){ if ( "date_format_custom_radio" != $(this).attr("id") ) - $("input[name='date_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() ); + $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() ); }); $("input[name='date_format_custom']").focus(function(){ $( '#date_format_custom_radio' ).prop( 'checked', true ); @@ -53,7 +53,7 @@ function options_general_add_js() { $("input[name='time_format']").click(function(){ if ( "time_format_custom_radio" != $(this).attr("id") ) - $("input[name='time_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() ); + $( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).text() ); }); $("input[name='time_format_custom']").focus(function(){ $( '#time_format_custom_radio' ).prop( 'checked', true ); @@ -121,8 +121,8 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); - -

+ +

@@ -131,13 +131,13 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); - class="regular-text code" /> -

to be different from the directory you installed WordPress.'); ?>

+ class="regular-text code" /> +

want your site home page to be different from your WordPress installation directory.' ); ?>

- -

+ +

@@ -155,8 +155,8 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); - -

The new address will not become active until confirmed.') ?>

+ +

The new address will not become active until confirmed.' ) ?>

@@ -192,7 +192,7 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists - @@ -200,7 +200,7 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists %1$s'), date_i18n($timezone_format)); ?> -

+


@@ -271,12 +271,13 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists echo " checked='checked'"; $custom = false; } - echo ' /> ' . date_i18n( $format ) . "
\n"; + echo ' /> ' . date_i18n( $format ) . "
\n"; } echo ' ' . date_i18n( get_option('date_format') ) . " \n"; + echo '/> ' . __( 'Custom:' ) . ' ' . __( 'enter a custom date format in the following field' ) . "\n"; + echo ' ' . __( 'example:' ) . ' ' . date_i18n( get_option('date_format') ) . " \n"; ?> @@ -303,12 +304,13 @@ if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists echo " checked='checked'"; $custom = false; } - echo ' /> ' . date_i18n( $format ) . "
\n"; + echo ' /> ' . date_i18n( $format ) . "
\n"; } echo ' ' . date_i18n( get_option('time_format') ) . " \n"; + echo '/> ' . __( 'Custom:' ) . ' ' . __( 'enter a custom time format in the following field' ) . "\n"; + echo ' ' . __( 'example:' ) . ' ' . date_i18n( get_option('time_format') ) . " \n"; echo "\t

" . __('Documentation on date and time formatting.') . "

\n"; ?>