X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..03f2fa83c13c1b532284205fa7efcab9b8b2c41f:/wp-includes/js/media-editor.js diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 2db4440d..5bf5bd3f 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -670,6 +670,7 @@ */ frame: function() { if ( this._frame ) { + wp.media.frame = this._frame; return this._frame; } @@ -880,7 +881,7 @@ if ( 'link' === type ) { _.defaults( embed, { - title: embed.url, + linkText: embed.url, linkUrl: embed.url }); @@ -1034,11 +1035,11 @@ */ link: function( embed ) { return wp.media.post( 'send-link-to-editor', { - nonce: wp.media.view.settings.nonce.sendToEditor, - src: embed.linkUrl, - title: embed.title, - html: wp.media.string.link( embed ), - post_id: wp.media.view.settings.post.id + nonce: wp.media.view.settings.nonce.sendToEditor, + src: embed.linkUrl, + link_text: embed.linkText, + html: wp.media.string.link( embed ), + post_id: wp.media.view.settings.post.id }); } }, @@ -1067,6 +1068,8 @@ workflow = this.add( id, options ); } + wp.media.frame = workflow; + return workflow.open(); }, @@ -1077,7 +1080,7 @@ */ init: function() { $(document.body) - .on( 'click', '.insert-media', function( event ) { + .on( 'click.add-media-button', '.insert-media', function( event ) { var elem = $( event.currentTarget ), editor = elem.data('editor'), options = { @@ -1093,7 +1096,7 @@ // Prevents Opera from showing the outline of the button // above the modal. // - // See: http://core.trac.wordpress.org/ticket/22445 + // See: https://core.trac.wordpress.org/ticket/22445 elem.blur(); if ( elem.hasClass( 'gallery' ) ) {