Ticket #14110: wp_get_attachment_image_shortened.diff
File wp_get_attachment_image_shortened.diff, 1.1 KB (added by , 14 years ago) |
---|
-
/Users/nephron/Sites/wordpress/wp-includes/
old new 638 638 $image = wp_get_attachment_image_src($attachment_id, $size, $icon); 639 639 if ( $image ) { 640 640 list($src, $width, $height) = $image; 641 $hwstring = image_hwstring($width, $height);642 641 if ( is_array($size) ) 643 642 $size = join('x', $size); 644 643 $attachment =& get_post($attachment_id); 645 644 $default_attr = array( 646 645 'src' => $src, 646 'height' => intval($height), 647 'width' => intval($width), 647 648 'class' => "attachment-$size", 648 649 'alt' => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first 649 650 'title' => trim(strip_tags( $attachment->post_title )), … … 656 657 $attr = wp_parse_args($attr, $default_attr); 657 658 $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment ); 658 659 $attr = array_map( 'esc_attr', $attr ); 659 $html = rtrim("<img $hwstring");660 $html = "<img"; 660 661 foreach ( $attr as $name => $value ) { 661 662 $html .= " $name=" . '"' . $value . '"'; 662 663 }