Ticket #21221: 21221.diff
File 21221.diff, 2.3 KB (added by , 13 years ago) |
---|
-
wp-includes/post-template.php
1147 1147 if ( $permalink ) 1148 1148 $url = get_attachment_link( $_post->ID ); 1149 1149 1150 $post_title = esc_attr( $_post->post_title);1150 $post_title = esc_attr( wptexturize( $_post->post_title ) ); 1151 1151 1152 1152 if ( $text ) 1153 1153 $link_text = $text; -
wp-includes/media.php
228 228 $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id; 229 229 $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); 230 230 231 $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr( $alt) . '" title="' . esc_attr($title).'" '.$hwstring.'class="'.$class.'" />';231 $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr( wptexturize( $alt ) ) . '" title="' . esc_attr( wptexturize( $title ) ).'" '.$hwstring.'class="'.$class.'" />'; 232 232 233 233 $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 234 234 … … 659 659 $default_attr = array( 660 660 'src' => $src, 661 661 'class' => "attachment-$size", 662 'alt' => trim( strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first663 'title' => trim( strip_tags( $attachment->post_title )),662 'alt' => trim( wptexturize( strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ) ) ), // Use Alt field first 663 'title' => trim( wptexturize( strip_tags( $attachment->post_title ) ) ), 664 664 ); 665 665 if ( empty($default_attr['alt']) ) 666 $default_attr['alt'] = trim( strip_tags( $attachment->post_excerpt )); // If not, Use the Caption666 $default_attr['alt'] = trim( wptexturize( strip_tags( $attachment->post_excerpt ) ) ); // If not, Use the Caption 667 667 if ( empty($default_attr['alt']) ) 668 $default_attr['alt'] = trim( strip_tags( $attachment->post_title )); // Finally, use the title668 $default_attr['alt'] = trim( wptexturize( strip_tags( $attachment->post_title ) ) ); // Finally, use the title 669 669 670 670 $attr = wp_parse_args($attr, $default_attr); 671 671 $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment );