WordPress.org

Make WordPress Core

Changeset 22409


Ignore:
Timestamp:
11/06/12 23:23:03 (2 years ago)
Author:
nacin
Message:

Stop adding title attributes to images (in the old media uploader). props martythornley. fixes #18984.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r22367 r22409  
    15281528            return false; 
    15291529 
    1530         if ( f.title.value ) { 
    1531             title = f.title.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); 
    1532             title = ' title="'+title+'"'; 
    1533         } 
    1534  
    15351530        if ( f.alt.value ) 
    15361531            alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); 
     
    15491544        cls = caption ? '' : ' class="'+t.align+'"'; 
    15501545 
    1551         html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />'; 
     1546        html = '<img alt="'+alt+'" src="'+f.src.value+'"'+cls+' width="'+t.width+'" height="'+t.height+'" />'; 
    15521547 
    15531548        if ( f.url.value ) { 
  • trunk/wp-includes/media.php

    r22362 r22409  
    229229    $class = apply_filters('get_image_tag_class', $class, $id, $align, $size); 
    230230 
    231     $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" title="' . esc_attr($title).'" '.$hwstring.'class="'.$class.'" />'; 
     231    $html = '<img src="' . esc_attr($img_src) . '" alt="' . esc_attr($alt) . '" '.$hwstring.'class="'.$class.'" />'; 
    232232 
    233233    $html = apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); 
     
    549549            'class' => "attachment-$size", 
    550550            'alt'   => trim(strip_tags( get_post_meta($attachment_id, '_wp_attachment_image_alt', true) )), // Use Alt field first 
    551             'title' => trim(strip_tags( $attachment->post_title )), 
    552551        ); 
    553552        if ( empty($default_attr['alt']) ) 
Note: See TracChangeset for help on using the changeset viewer.