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: https://develop.svn.wordpress.org/trunk@22747 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-21 11:50:30 +00:00
parent e9670df395
commit 59be9048dd
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 );