Ticket #19570: 19570.gallery-shortcode.diff
File 19570.gallery-shortcode.diff, 870 bytes (added by , 12 years ago) |
---|
-
wp-includes/js/media-editor.js
476 476 }, this ); 477 477 478 478 workflow.state('gallery-edit').on( 'update', function( selection ) { 479 this.insert( wp.media.gallery.shortcode( selection ).string() ); 479 var formatTab = $( '.nav-tab-active' ), 480 sCode = wp.media.gallery.shortcode( selection ).string(); 481 482 // If they are on the gallery post format tab, add the 483 // shortcode to the gallery post format field 484 if ( formatTab && 'gallery' === formatTab.data( 'wp-format' ) ) 485 $( '#wp_format_gallery' ).val( sCode ); 486 // else add it to the editor 487 else 488 this.insert( sCode ); 480 489 }, this ); 481 490 482 491 workflow.state('embed').on( 'select', function() {