Make WordPress Core

Ticket #21785: 21785-accessibility.diff

File 21785-accessibility.diff, 3.8 KB (added by ehg, 11 years ago)
  • src/wp-admin/css/customize-controls.css

    diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css
    index f9ca1d7..e9ef0f2 100644
    body { 
    465465        margin-bottom: 18px;
    466466}
    467467
     468#customize-control-header_image .uploaded button, #customize-control-header_image .default button {
     469        width: 100%;
     470        padding: 0;
     471        margin: 0;
     472        background: none;
     473        border: none;
     474        color: inherit;
     475        cursor: pointer;
     476}
     477
    468478/* Header control: current image container */
    469479
    470480#customize-control-header_image .current .container {
  • src/wp-admin/custom-header.php

    diff --git src/wp-admin/custom-header.php src/wp-admin/custom-header.php
    index 4a2d44c..2a6a2f3 100644
    wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> 
    12721272        public function get_uploaded_header_images() {
    12731273                $header_images = get_uploaded_header_images();
    12741274                $timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
     1275                $alt_text_key = '_wp_attachment_image_alt';
    12751276
    12761277                foreach ( $header_images as &$header_image ) {
    1277                         $header_image['timestamp'] = get_post_meta( $header_image['attachment_id'], $timestamp_key, true );
     1278                        $header_meta = get_post_meta( $header_image['attachment_id'] );
     1279                        $header_image['timestamp'] = isset( $header_meta[ $timestamp_key ] ) ? $header_meta[ $timestamp_key ] : '';
     1280                        $header_image['alt_text'] = isset( $header_meta[ $alt_text_key ] ) ? $header_meta[ $alt_text_key ] : '';
    12781281                }
    12791282
    12801283                return $header_images;
  • src/wp-includes/class-wp-customize-control.php

    diff --git src/wp-includes/class-wp-customize-control.php src/wp-includes/class-wp-customize-control.php
    index e55a759..0b732c6 100644
    final class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control 
    774774
    775775                        <div class="placeholder random">
    776776                                <div class="inner">
    777                                         <span><span class="dashicons dashicons-randomize dice"></span>
     777                                        <button type="button"><span class="dashicons dashicons-randomize dice"></span>
    778778                                        <# if ( data.type === 'uploaded' ) { #>
    779779                                                <?php _e( 'Randomize uploaded headers' ); ?>
    780780                                        <# } else if ( data.type === 'default' ) { #>
    781781                                                <?php _e( 'Randomize suggested headers' ); ?>
    782782                                        <# } #>
    783                                         </span>
     783                                        </button>
    784784                                </div>
    785785                        </div>
    786786
    787787                        <# } else { #>
    788788
    789789                        <# if (data.type === 'uploaded') { #>
    790                         <div class="dashicons dashicons-no close"></div>
     790                                <div class="dashicons dashicons-no close"></div>
    791791                        <# } #>
    792792
    793                         <a href="#" class="choice thumbnail #>"
     793                        <button type="button" class="choice thumbnail"
    794794                                data-customize-image-value="{{{data.header.url}}}"
    795795                                data-customize-header-image-data="{{JSON.stringify(data.header)}}">
    796                                 <img src="{{{data.header.thumbnail_url}}}">
    797                         </a>
     796                                <span class="screen-reader-text"><?php _e( 'Set image' ); ?></span>
     797                                <img src="{{{data.header.thumbnail_url}}}" alt="{{{data.header.alt_text || data.header.description}}}">
     798                        </button>
    798799
    799800                        <# } #>
    800801                </script>
    final class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control 
    875876                        </div>
    876877                        <div class="actions">
    877878                                <?php /* translators: Hide as in hide header image via the Customizer */ ?>
    878                                 <a href="#" <?php echo $visibility ?> class="button remove"><?php _ex( 'Hide', 'custom header' ); ?></a>
     879                                <button type="button"<?php echo $visibility ?> class="button remove"><?php _ex( 'Hide image', 'custom header' ); ?></button>
    879880                                <?php /* translators: New as in add new header image via the Customizer */ ?>
    880                                 <a href="#" class="button new"><?php _ex( 'Add new', 'header image' ); ?></a>
     881                                <button type="button" class="button new"><?php _ex( 'Add new image', 'header image' ); ?></button>
    881882                                <div style="clear:both"></div>
    882883                        </div>
    883884                        <div class="choices">