Ticket #36735: 36735.1.patch
File 36735.1.patch, 988 bytes (added by , 8 years ago) |
---|
-
src/wp-includes/js/media-editor.js
55 55 fallbacks = function( props ) { 56 56 // Generate alt fallbacks and strip tags. 57 57 if ( 'image' === props.type && ! props.alt ) { 58 props.alt = props.caption || props.title || ''; 58 if( props.caption ) { 59 props.alt = props.caption; 60 } else if( props.title !== props.url ){ 61 props.alt = props.title; 62 } else { 63 props.alt = ''; 64 } 59 65 props.alt = props.alt.replace( /<\/?[^>]+>/g, '' ); 60 66 props.alt = props.alt.replace( /[\r\n]+/g, ' ' ); 61 67 } … … 232 238 image: function( props, attachment ) { 233 239 var img = {}, 234 240 options, classes, shortcode, html; 235 241 242 props.type = 'image'; 236 243 props = wp.media.string.props( props, attachment ); 237 244 classes = props.classes || []; 238 245