From 8f3a9e1907fd3316adb590af6a0689370ed9ef93 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 21 Nov 2012 11:50:30 +0000 Subject: [PATCH] Stop inserting title attributes for images inserted into the editor by modifying get_image_send_to_editor(), not the generic get_image_tag(). see #18984, [22409]. git-svn-id: http://core.svn.wordpress.org/trunk@22747 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 2 +- wp-includes/media.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 478dfdd768..c1933335d4 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -106,7 +106,7 @@ function the_media_upload_tabs() { */ function get_image_send_to_editor($id, $caption, $title, $align, $url='', $rel = false, $size='medium', $alt = '') { - $html = get_image_tag($id, $alt, $title, $align, $size); + $html = get_image_tag($id, $alt, '', $align, $size); $rel = $rel ? ' rel="attachment wp-att-' . esc_attr($id).'"' : ''; diff --git a/wp-includes/media.php b/wp-includes/media.php index 015e6f21fd..1e5cc377d4 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -225,10 +225,12 @@ function get_image_tag($id, $alt, $title, $align, $size='medium') { list( $img_src, $width, $height ) = image_downsize($id, $size); $hwstring = image_hwstring($width, $height); + $title = $title ? 'title="' . esc_attr( $title ) . '" ' : ''; + $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 );