WordPress.org

Make WordPress Core

Changeset 35567


Ignore:
Timestamp:
11/07/15 16:11:38 (17 months ago)
Author:
wonderboymusic
Message:

Accessibility: add missing alt attributes to a gaggle of <img>s.

Props afercia.
Fixes #34583.

Location:
trunk/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/about.php

    r34054 r35567  
    135135                    else: 
    136136                    ?> 
    137                     <img src="<?php echo esc_url( $feature['src'] ); ?>" /> 
     137                    <img src="<?php echo esc_url( $feature['src'] ); ?>" alt="" /> 
    138138                    <?php endif; ?> 
    139139                </div> 
     
    148148            <div class="col"> 
    149149                <div class="svg-container"> 
    150                     <img src="<?php echo esc_attr( $feature['src'] ); ?>" /> 
     150                    <img src="<?php echo esc_attr( $feature['src'] ); ?>" alt="" /> 
    151151                </div> 
    152152                <h3><?php echo $feature['heading']; ?></h3> 
  • trunk/src/wp-admin/custom-header.php

    r34566 r35567  
    772772 
    773773    <div id="crop_image" style="position: relative"> 
    774         <img src="<?php echo esc_url( $url ); ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" /> 
     774        <img src="<?php echo esc_url( $url ); ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" alt="" /> 
    775775    </div> 
    776776 
  • trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php

    r35241 r35567  
    303303        ?> 
    304304        <a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>"> 
    305             <img src="<?php echo esc_url( $theme->screenshot_url ); ?>" width="150" /> 
     305            <img src="<?php echo esc_url( $theme->screenshot_url ); ?>" width="150" alt="" /> 
    306306        </a> 
    307307 
     
    413413            <span class="theme-by"><?php printf( __( 'By %s' ), $author ); ?></span> 
    414414            <?php if ( isset( $theme->screenshot_url ) ): ?> 
    415                 <img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" /> 
     415                <img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt="" /> 
    416416            <?php endif; ?> 
    417417            <div class="theme-details"> 
  • trunk/src/wp-admin/includes/image-edit.php

    r35427 r35567  
    185185 
    186186        <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> 
    187         <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" /> 
     187        <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" alt="<?php esc_attr_e( 'Image preview' ); ?>" /> 
    188188        </div> 
    189189 
  • trunk/src/wp-admin/includes/plugin-install.php

    r35009 r35567  
    606606                    $contrib_username = sanitize_user( $contrib_username ); 
    607607                    if ( empty( $contrib_profile ) ) { 
    608                         echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>"; 
     608                        echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' alt='' />{$contrib_username}</li>"; 
    609609                    } else { 
    610                         echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>"; 
     610                        echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' alt='' />{$contrib_username}</a></li>"; 
    611611                    } 
    612612                } 
  • trunk/src/wp-admin/includes/post.php

    r35482 r35567  
    16161616            <p class="wp-tab-first" tabindex="0"> 
    16171617            <span class="currently-editing"></span><br /> 
    1618             <span class="locked-saving hidden"><img src="<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>" width="16" height="16" /> <?php _e('Saving revision&hellip;'); ?></span> 
     1618            <span class="locked-saving hidden"><img src="<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>" width="16" height="16" alt="" /> <?php _e( 'Saving revision&hellip;' ); ?></span> 
    16191619            <span class="locked-saved hidden"><?php _e('Your latest changes were saved as a revision.'); ?></span> 
    16201620            </p> 
  • trunk/src/wp-admin/js/image-edit.js

    r31996 r35567  
    166166        }; 
    167167 
    168         img = $('<img id="image-preview-' + postid + '" />') 
     168        img = $( '<img id="image-preview-' + postid + '" alt="" />' ) 
    169169            .on('load', function() { 
    170170                var max1, max2, parent = $('#imgedit-crop-' + postid), t = imageEdit; 
  • trunk/src/wp-admin/js/inline-edit-post.js

    r34977 r35567  
    333333 
    334334                if ( lock_data.avatar_src ) { 
    335                     avatar = $('<img class="avatar avatar-18 photo" width="18" height="18" />').attr( 'src', lock_data.avatar_src.replace(/&amp;/g, '&') ); 
     335                    avatar = $( '<img class="avatar avatar-18 photo" width="18" height="18" alt="" />' ).attr( 'src', lock_data.avatar_src.replace( /&amp;/g, '&' ) ); 
    336336                    row.find('.column-title .locked-avatar').empty().append( avatar ); 
    337337                } 
  • trunk/src/wp-admin/js/post.js

    r35229 r35567  
    132132 
    133133                if ( received.lock_error.avatar_src ) { 
    134                     avatar = $('<img class="avatar avatar-64 photo" width="64" height="64" />').attr( 'src', received.lock_error.avatar_src.replace(/&amp;/g, '&') ); 
     134                    avatar = $( '<img class="avatar avatar-64 photo" width="64" height="64" alt="" />' ).attr( 'src', received.lock_error.avatar_src.replace( /&amp;/g, '&' ) ); 
    135135                    wrap.find('div.post-locked-avatar').empty().append( avatar ); 
    136136                } 
  • trunk/src/wp-admin/js/press-this.js

    r33836 r35567  
    324324                } 
    325325 
    326                 newContent = '<a href="' + link + '"><img class="alignnone size-full" src="' + src + '" /></a>'; 
     326                newContent = '<a href="' + link + '"><img class="alignnone size-full" src="' + src + '" alt="" /></a>'; 
    327327            } else { 
    328328                newContent = '[embed]' + src + '[/embed]'; 
  • trunk/src/wp-admin/update-core.php

    r34598 r35567  
    361361    <tr> 
    362362        <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' /></th> 
    363         <td class='plugin-title'><img src='" . esc_url( $theme->get_screenshot() ) . "' width='85' height='64' style='float:left; padding: 0 5px 5px' /><strong>" . $theme->display('Name') . '</strong> ' . sprintf( __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display('Version'), $theme->update['new_version'] ) . "</td> 
     363        <td class='plugin-title'><img src='" . esc_url( $theme->get_screenshot() ) . "' width='85' height='64' style='float:left; padding: 0 5px 5px' alt='' /><strong>" . $theme->display('Name') . '</strong> ' . sprintf( __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display('Version'), $theme->update['new_version'] ) . "</td> 
    364364    </tr>"; 
    365365    } 
  • trunk/src/wp-includes/customize/class-wp-customize-media-control.php

    r35389 r35567  
    158158                        <div class="thumbnail thumbnail-{{ data.attachment.type }}"> 
    159159                            <# if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.medium ) { #> 
    160                                 <img class="attachment-thumb" src="{{ data.attachment.sizes.medium.url }}" draggable="false" /> 
     160                                <img class="attachment-thumb" src="{{ data.attachment.sizes.medium.url }}" draggable="false" alt="" /> 
    161161                            <# } else if ( 'image' === data.attachment.type && data.attachment.sizes && data.attachment.sizes.full ) { #> 
    162                                 <img class="attachment-thumb" src="{{ data.attachment.sizes.full.url }}" draggable="false" /> 
     162                                <img class="attachment-thumb" src="{{ data.attachment.sizes.full.url }}" draggable="false" alt="" /> 
    163163                            <# } else if ( 'audio' === data.attachment.type ) { #> 
    164164                                <# if ( data.attachment.image && data.attachment.image.src && data.attachment.image.src !== data.attachment.icon ) { #> 
    165                                     <img src="{{ data.attachment.image.src }}" class="thumbnail" draggable="false" /> 
     165                                    <img src="{{ data.attachment.image.src }}" class="thumbnail" draggable="false" alt="" /> 
    166166                                <# } else { #> 
    167                                     <img src="{{ data.attachment.icon }}" class="attachment-thumb type-icon" draggable="false" /> 
     167                                    <img src="{{ data.attachment.icon }}" class="attachment-thumb type-icon" draggable="false" alt="" /> 
    168168                                <# } #> 
    169169                                <p class="attachment-meta attachment-meta-title">&#8220;{{ data.attachment.title }}&#8221;</p> 
     
    185185                                </div> 
    186186                            <# } else { #> 
    187                                 <img class="attachment-thumb type-icon icon" src="{{ data.attachment.icon }}" draggable="false" /> 
     187                                <img class="attachment-thumb type-icon icon" src="{{ data.attachment.icon }}" draggable="false" alt="" /> 
    188188                                <p class="attachment-title">{{ data.attachment.title }}</p> 
    189189                            <# } #> 
  • trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

    r35217 r35567  
    101101                event.content = event.content.replace( /<!--more(.*?)-->/g, function( match, moretext ) { 
    102102                    return '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="more" data-wp-more-text="' + moretext + '" ' + 
    103                         'class="wp-more-tag mce-wp-more" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />'; 
     103                        'class="wp-more-tag mce-wp-more" alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />'; 
    104104                }); 
    105105            } 
     
    110110                event.content = event.content.replace( /<!--nextpage-->/g, 
    111111                    '<img src="' + tinymce.Env.transparentSrc + '" data-wp-more="nextpage" class="wp-more-tag mce-wp-nextpage" ' + 
    112                         'title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' ); 
     112                        'alt="" title="' + title + '" data-mce-resize="false" data-mce-placeholder="1" />' ); 
    113113            } 
    114114 
     
    163163        title = tag === 'more' ? 'Read more...' : 'Next page'; 
    164164        title = __( title ); 
    165         html = '<img src="' + tinymce.Env.transparentSrc + '" title="' + title + '" class="' + classname + '" ' + 
     165        html = '<img src="' + tinymce.Env.transparentSrc + '" alt="" title="' + title + '" class="' + classname + '" ' + 
    166166            'data-wp-more="' + tag + '" data-mce-resize="false" data-mce-placeholder="1" />'; 
    167167 
  • trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js

    r29883 r35567  
    1111        data = window.encodeURIComponent( data ); 
    1212        return '<img src="' + tinymce.Env.transparentSrc + '" class="wp-media mceItem ' + cls + '" ' + 
    13             'data-wp-media="' + data + '" data-mce-resize="false" data-mce-placeholder="1" />'; 
     13            'data-wp-media="' + data + '" data-mce-resize="false" data-mce-placeholder="1" alt="" />'; 
    1414    } 
    1515 
  • trunk/src/wp-includes/media-template.php

    r35463 r35567  
    292292                    <div class="media-progress-bar"><div></div></div> 
    293293                <# } else if ( 'image' === data.type && data.sizes && data.sizes.large ) { #> 
    294                     <img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" /> 
     294                    <img class="details-image" src="{{ data.sizes.large.url }}" draggable="false" alt="" /> 
    295295                <# } else if ( 'image' === data.type && data.sizes && data.sizes.full ) { #> 
    296                     <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" /> 
     296                    <img class="details-image" src="{{ data.sizes.full.url }}" draggable="false" alt="" /> 
    297297                <# } else if ( -1 === jQuery.inArray( data.type, [ 'audio', 'video' ] ) ) { #> 
    298                     <img class="details-image icon" src="{{ data.icon }}" draggable="false" /> 
     298                    <img class="details-image icon" src="{{ data.icon }}" draggable="false" alt="" /> 
    299299                <# } #> 
    300300 
     
    454454                    <div class="centered"> 
    455455                        <# if ( data.image && data.image.src && data.image.src !== data.icon ) { #> 
    456                             <img src="{{ data.image.src }}" class="thumbnail" draggable="false" /> 
     456                            <img src="{{ data.image.src }}" class="thumbnail" draggable="false" alt="" /> 
    457457                        <# } else { #> 
    458                             <img src="{{ data.icon }}" class="icon" draggable="false" /> 
     458                            <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> 
    459459                        <# } #> 
    460460                    </div> 
     
    503503                    <div class="media-progress-bar"><div></div></div> 
    504504                <# } else if ( 'image' === data.type && data.sizes ) { #> 
    505                     <img src="{{ data.size.url }}" draggable="false" /> 
     505                    <img src="{{ data.size.url }}" draggable="false" alt="" /> 
    506506                <# } else { #> 
    507                     <img src="{{ data.icon }}" class="icon" draggable="false" /> 
     507                    <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> 
    508508                <# } #> 
    509509            </div> 
     
    821821    <script type="text/html" id="tmpl-embed-image-settings"> 
    822822        <div class="thumbnail"> 
    823             <img src="{{ data.model.url }}" draggable="false" /> 
     823            <img src="{{ data.model.url }}" draggable="false" alt="" /> 
    824824        </div> 
    825825 
     
    878878                <div class="column-image"> 
    879879                    <div class="image"> 
    880                         <img src="{{ data.model.url }}" draggable="false" /> 
     880                        <img src="{{ data.model.url }}" draggable="false" alt="" /> 
    881881 
    882882                        <# if ( data.attachment && window.imageEdit ) { #> 
     
    12091209                        <dt class="gallery-icon"> 
    12101210                            <# if ( attachment.thumbnail ) { #> 
    1211                                 <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" /> 
     1211                                <img src="{{ attachment.thumbnail.url }}" width="{{ attachment.thumbnail.width }}" height="{{ attachment.thumbnail.height }}" alt="" /> 
    12121212                            <# } else { #> 
    1213                                 <img src="{{ attachment.url }}" /> 
     1213                                <img src="{{ attachment.url }}" alt="" /> 
    12141214                            <# } #> 
    12151215                        </dt> 
     
    12331233 
    12341234    <script type="text/html" id="tmpl-crop-content"> 
    1235         <img class="crop-image" src="{{ data.url }}"> 
     1235        <img class="crop-image" src="{{ data.url }}" alt=""> 
    12361236        <div class="upload-errors"></div> 
    12371237    </script> 
     
    12411241        <strong><?php _e( 'As a browser icon' ); ?></strong> 
    12421242        <div class="favicon-preview"> 
    1243             <img src="images/browser.png" class="browser-preview" width="182" height="" alt=""/> 
     1243            <img src="images/browser.png" class="browser-preview" width="182" height="" alt="" /> 
    12441244 
    12451245            <div class="favicon"> 
  • trunk/src/wp-includes/media.php

    r35561 r35567  
    16731673<script type="text/html" id="tmpl-wp-playlist-current-item"> 
    16741674    <# if ( data.image ) { #> 
    1675     <img src="{{ data.thumb.src }}"/> 
     1675    <img src="{{ data.thumb.src }}" alt="" /> 
    16761676    <# } #> 
    16771677    <div class="wp-playlist-caption"> 
Note: See TracChangeset for help on using the changeset viewer.