Make WordPress Core

Ticket #21221: 21221.diff

File 21221.diff, 2.3 KB (added by stephdau, 13 years ago)
  • wp-includes/post-template.php

     
    11471147        if ( $permalink )
    11481148                $url = get_attachment_link( $_post->ID );
    11491149
    1150         $post_title = esc_attr( $_post->post_title );
     1150        $post_title = esc_attr( wptexturize( $_post->post_title ) );
    11511151
    11521152        if ( $text )
    11531153                $link_text = $text;
  • wp-includes/media.php

     
    228228        $class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
    229229        $class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
    230230
    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.'" />';
    232232
    233233        $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
    234234
     
    659659                $default_attr = array(
    660660                        'src'   => $src,
    661661                        'class' => "attachment-$size",
    662                         'alt'   => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first
    663                         '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 ) ) ),
    664664                );
    665665                if ( empty($default_attr['alt']) )
    666                         $default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption
     666                        $default_attr['alt'] = trim( wptexturize( strip_tags( $attachment->post_excerpt ) ) ); // If not, Use the Caption
    667667                if ( empty($default_attr['alt']) )
    668                         $default_attr['alt'] = trim(strip_tags( $attachment->post_title )); // Finally, use the title
     668                        $default_attr['alt'] = trim( wptexturize( strip_tags( $attachment->post_title ) ) ); // Finally, use the title
    669669
    670670                $attr = wp_parse_args($attr, $default_attr);
    671671                $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment );