WordPress.org

Make WordPress Core

Changeset 36000


Ignore:
Timestamp:
12/17/15 23:43:57 (21 months ago)
Author:
afercia
Message:

Accessibility: Remove the title attribute from the Featured Image postbox thumbnail.

The title attribute is now replaced with plain text in a howto paragraph, as done for example in the Tags postbox.
Adds an aria-describedby attribute on the thumbnail link to target the description.
Also, fixes the focus style on the featured image thumbnail.

Fixes #35076.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/edit.css

    r35563 r36000  
    304304} 
    305305 
     306#set-post-thumbnail { 
     307    display: inline-block; 
     308    max-width: 100%; 
     309} 
     310 
    306311#postimagediv .inside img { 
    307312    max-width: 100%; 
    308313    height: auto; 
    309314    width: auto; 
     315    vertical-align: top; 
    310316    background-image: -webkit-linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), -webkit-linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4); 
    311317    background-image: linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4); 
  • trunk/src/wp-admin/includes/post.php

    r35818 r36000  
    13811381    $post               = get_post( $post ); 
    13821382    $post_type_object   = get_post_type_object( $post->post_type ); 
    1383     $set_thumbnail_link = '<p class="hide-if-no-js"><a title="%s" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 
     1383    $set_thumbnail_link = '<p class="hide-if-no-js"><a href="%s" id="set-post-thumbnail" aria-describedby="set-post-thumbnail-desc" class="thickbox">%s</a></p>'; 
    13841384    $upload_iframe_src  = get_upload_iframe_src( 'image', $post->ID ); 
    13851385 
    13861386    $content = sprintf( $set_thumbnail_link, 
    1387         esc_attr( $post_type_object->labels->set_featured_image ), 
    13881387        esc_url( $upload_iframe_src ), 
    13891388        esc_html( $post_type_object->labels->set_featured_image ) 
     
    14171416            $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); 
    14181417            $content = sprintf( $set_thumbnail_link, 
    1419                 esc_attr( $post_type_object->labels->set_featured_image ), 
    14201418                esc_url( $upload_iframe_src ), 
    14211419                $thumbnail_html 
    14221420            ); 
     1421            $content .= '<p class="hide-if-no-js howto" id="set-post-thumbnail-desc">' . __( 'Click the image to edit or update' ) . '</p>'; 
    14231422            $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>'; 
    14241423        } 
Note: See TracChangeset for help on using the changeset viewer.