Make WordPress Core

Ticket #30525: mediaattributes.diff

File mediaattributes.diff, 1.2 KB (added by hereswhatidid, 10 years ago)
  • wp-includes/media.php

     
    696696        $image = wp_get_attachment_image_src($attachment_id, $size, $icon);
    697697        if ( $image ) {
    698698                list($src, $width, $height) = $image;
    699                 $hwstring = image_hwstring($width, $height);
    700699                $size_class = $size;
    701700                if ( is_array( $size_class ) ) {
    702701                        $size_class = join( 'x', $size_class );
     
    706705                        'src'   => $src,
    707706                        'class' => "attachment-$size_class",
    708707                        'alt'   => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first
     708                        'width' => $width,
     709                        'height' => $height,
    709710                );
    710711                if ( empty($default_attr['alt']) )
    711712                        $default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption
     
    725726                 */
    726727                $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );
    727728                $attr = array_map( 'esc_attr', $attr );
    728                 $html = rtrim("<img $hwstring");
     729                $html = '<img';
    729730                foreach ( $attr as $name => $value ) {
    730731                        $html .= " $name=" . '"' . $value . '"';
    731732                }