X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..00dbffaf1593b0ac719d98f00839221a9ca52133:/wp-includes/js/media-editor.js diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 34777677..15eff8da 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -9,7 +9,8 @@ // outputting the proper object format based on the // attachment's type. props: function( props, attachment ) { - var link, linkUrl, size, sizes, fallbacks; + var link, linkUrl, size, sizes, fallbacks, + defaultProps = wp.media.view.settings.defaultProps; // Final fallbacks run after all processing has been completed. fallbacks = function( props ) { @@ -17,6 +18,7 @@ if ( 'image' === props.type && ! props.alt ) { props.alt = props.caption || props.title || ''; props.alt = props.alt.replace( /<\/?[^>]+>/g, '' ); + props.alt = props.alt.replace( /[\r\n]+/g, ' ' ); } return props; @@ -29,8 +31,8 @@ if ( 'image' === props.type ) { props = _.defaults( props || {}, { - align: getUserSetting( 'align', 'none' ), - size: getUserSetting( 'imgsize', 'medium' ), + align: defaultProps.align || getUserSetting( 'align', 'none' ), + size: defaultProps.size || getUserSetting( 'imgsize', 'medium' ), url: '', classes: [] }); @@ -42,7 +44,7 @@ props.title = props.title || attachment.title; - link = props.link || getUserSetting( 'urlbutton', 'post' ); + link = props.link || defaultProps.link || getUserSetting( 'urlbutton', 'file' ); if ( 'file' === link ) linkUrl = attachment.url; else if ( 'post' === link ) @@ -167,7 +169,7 @@ itemtag: 'dl', icontag: 'dt', captiontag: 'dd', - columns: 3, + columns: '3', size: 'thumbnail', orderby: 'menu_order ID' },