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
This commit is contained in:
Andrew Nacin 2012-11-21 11:50:30 +00:00
parent ff1707892d
commit 8f3a9e1907
2 changed files with 4 additions and 2 deletions

View File

@ -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).'"' : '';

View File

@ -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 = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" '.$hwstring.'class="'.$class.'" />';
$html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
$html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size );