Stop adding title attributes to images (in the old media uploader). props martythornley. fixes #18984.
git-svn-id: https://develop.svn.wordpress.org/trunk@22409 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
003319cdf6
commit
8d1e29d8b6
|
@ -1527,11 +1527,6 @@ var addExtImage = {
|
||||||
if ( '' == f.src.value || '' == t.width )
|
if ( '' == f.src.value || '' == t.width )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( f.title.value ) {
|
|
||||||
title = f.title.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
|
||||||
title = ' title="'+title+'"';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( f.alt.value )
|
if ( f.alt.value )
|
||||||
alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
|
||||||
|
@ -1548,7 +1543,7 @@ var addExtImage = {
|
||||||
|
|
||||||
cls = caption ? '' : ' class="'+t.align+'"';
|
cls = caption ? '' : ' class="'+t.align+'"';
|
||||||
|
|
||||||
html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
|
html = '<img alt="'+alt+'" src="'+f.src.value+'"'+cls+' width="'+t.width+'" height="'+t.height+'" />';
|
||||||
|
|
||||||
if ( f.url.value ) {
|
if ( f.url.value ) {
|
||||||
url = f.url.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
url = f.url.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
|
|
@ -228,7 +228,7 @@ function get_image_tag($id, $alt, $title, $align, $size='medium') {
|
||||||
$class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
|
$class = 'align' . esc_attr($align) .' size-' . esc_attr($size) . ' wp-image-' . $id;
|
||||||
$class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
|
$class = apply_filters('get_image_tag_class', $class, $id, $align, $size);
|
||||||
|
|
||||||
$html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" title="' . esc_attr($title).'" '.$hwstring.'class="'.$class.'" />';
|
$html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" '.$hwstring.'class="'.$class.'" />';
|
||||||
|
|
||||||
$html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
|
$html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );
|
||||||
|
|
||||||
|
@ -548,7 +548,6 @@ function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = fa
|
||||||
'src' => $src,
|
'src' => $src,
|
||||||
'class' => "attachment-$size",
|
'class' => "attachment-$size",
|
||||||
'alt' => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first
|
'alt' => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first
|
||||||
'title' => trim(strip_tags( $attachment->post_title )),
|
|
||||||
);
|
);
|
||||||
if ( empty($default_attr['alt']) )
|
if ( empty($default_attr['alt']) )
|
||||||
$default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption
|
$default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption
|
||||||
|
|
Loading…
Reference in New Issue