Improve keyboard accessibility on Custom Header and Custom Background screen.

props florianziegler.
fixes #29289.

git-svn-id: https://develop.svn.wordpress.org/trunk@30327 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2014-11-13 11:59:23 +00:00
parent 9c6b323976
commit 8d61151356
5 changed files with 10 additions and 10 deletions

View File

@ -317,9 +317,9 @@ class Custom_Background {
</p>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
<a id="choose-from-library-link" class="button"
<button id="choose-from-library-link" class="button"
data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>"
data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></a>
data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></button>
</p>
</form>
</td>

View File

@ -557,7 +557,7 @@ class Custom_Image_Header {
else
$style = ' style="display:none;"';
?>
<h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo('url'); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo('url'); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc" class="displaying-header-text" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
</div>
<?php } ?>
@ -604,10 +604,10 @@ class Custom_Image_Header {
?>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
<a id="choose-from-library-link" class="button"
<button id="choose-from-library-link" class="button"
data-update-link="<?php echo esc_attr( $modal_update_href ); ?>"
data-choose="<?php esc_attr_e( 'Choose a Custom Header' ); ?>"
data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></a>
data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></button>
</p>
</form>
</td>

View File

@ -143,7 +143,7 @@ function twentyfifteen_admin_header_image() {
$header_background_color = get_theme_mod( 'header_background_color', $color_scheme[1] );
?>
<div id="headimg" style="background-image: url(<?php header_image(); ?>); background-color: <?php echo esc_attr( $header_background_color ); ?>;">
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
</div>
<?php
@ -341,4 +341,4 @@ function twentyfifteen_admin_fonts() {
wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null );
wp_enqueue_style( 'twentyfifteen-custom-header', get_template_directory_uri() . '/css/admin-custom-header.css', array(), '20141010' );
}
add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfifteen_admin_fonts' );
add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfifteen_admin_fonts' );

View File

@ -220,7 +220,7 @@ function twentythirteen_admin_header_image() {
<div id="headimg" style="background: url(<?php header_image(); ?>) no-repeat scroll top; background-size: 1600px auto;">
<?php $style = ' style="color:#' . get_header_textcolor() . ';"'; ?>
<div class="home-link">
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="#"><?php bloginfo( 'name' ); ?></a></h1>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="#" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
</div>
</div>

View File

@ -155,11 +155,11 @@ function twentytwelve_admin_header_image() {
else
$style = ' style="color:#' . get_header_textcolor() . ';"';
?>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
<?php endif; ?>
</div>
<?php }
<?php }