diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index e58725d585..a7c5bce481 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1527,11 +1527,6 @@ var addExtImage = { if ( '' == f.src.value || '' == t.width ) return false; - if ( f.title.value ) { - title = f.title.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); - title = ' title="'+title+'"'; - } - if ( f.alt.value ) alt = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); @@ -1548,7 +1543,7 @@ var addExtImage = { cls = caption ? '' : ' class="'+t.align+'"'; - html = ''+alt+''; + html = ''+alt+''; if ( f.url.value ) { url = f.url.value.replace(/'/g, ''').replace(/"/g, '"').replace(//g, '>'); diff --git a/wp-includes/media.php b/wp-includes/media.php index 079aab574c..5144f5df6e 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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 = apply_filters('get_image_tag_class', $class, $id, $align, $size); - $html = '' . esc_attr($alt) . ''; + $html = '' . esc_attr($alt) . ''; $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, 'class' => "attachment-$size", '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']) ) $default_attr['alt'] = trim(strip_tags( $attachment->post_excerpt )); // If not, Use the Caption