Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Last active December 10, 2015 00:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/87b4085e39dc5d8faafa to your computer and use it in GitHub Desktop.
Save mikejolley/87b4085e39dc5d8faafa to your computer and use it in GitHub Desktop.
// When an image is selected, run a callback.
file_frame.on( 'select', function() {
var selection = file_frame.state().get('selection');
selection.map( function( attachment ) {
attachment = attachment.toJSON();
// Do something with attachment.id and/or attachment.url here
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment