This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var me = wp.media.editor; | |
// backup the original method | |
var orig = me.send.attachment; | |
// set our own function | |
me.send.attachment = myCallback; | |
// open our instance of the media uploader and bind to escape/insert method | |
me.open("myinstance").on("escape insert",function () { | |
// get our instance back and unbind all our event listeners | |
me.get("myinstance").off(null,null,this); | |
// restore original method | |
me.send.attachment = orig; | |
},this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment