Changeset 22170
- Timestamp:
- 10/10/2012 09:54:21 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/media-upload.js
r22156 r22170 109 109 110 110 workflow.on( 'update:insert', function( selection ) { 111 this.insert( '\n' + selection.map( function( attachment ) { 112 return wp.media.string.image( attachment ); 113 }).join('\n\n') + '\n' ); 111 this.insert( selection.map( function( attachment ) { 112 if ( 'image' === attachment.get('type') ) 113 return '\n' + wp.media.string.image( attachment ) + '\n'; 114 else 115 return wp.media.string.link( attachment ) + ' '; 116 }).join('') ); 114 117 }, this ); 115 118 -
trunk/wp-includes/js/mce-view.js
r22162 r22170 372 372 373 373 wp.media.string = {}; 374 375 wp.media.string.link = function( attachment ) { 376 var linkTo = getUserSetting( 'urlbutton', 'post' ), 377 options = { 378 tag: 'a', 379 content: attachment.get('title') || attachment.get('filename'), 380 attrs: { 381 rel: 'attachment wp-att-' + attachment.id 382 } 383 }; 384 385 // Attachments can be linked to attachment post pages or to the direct 386 // URL. `none` is not a valid option. 387 options.attrs.href = ( linkTo === 'file' ) ? attachment.get('url') : attachment.get('link'); 388 389 return wp.html.string( options ); 390 }; 391 374 392 wp.media.string.image = function( attachment, props ) { 375 393 var classes, img, options, size; -
trunk/wp-includes/media.php
r22160 r22170 1247 1247 'filename' => basename( $attachment->guid ), 1248 1248 'url' => $attachment_url, 1249 'link' => get_attachment_link( $attachment->ID ), 1249 1250 'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), 1250 1251 'author' => $attachment->post_author,
Note: See TracChangeset
for help on using the changeset viewer.