I’m wondering how to make WP3.5 media uploader return 2 or more items in attachement
? It always runs once even if 2 items are selected. The code:
$('.button').on('click', function(){
var send_attachment_backup = wp.media.editor.send.attachment;
wp.media.editor.send.attachment = function(props, attachment){
myFunction(attachment.url);
wp.media.editor.send.attachment = send_attachment_backup;
}
wp.media.editor.open();
});
EDIT: My mistake. I’m doing wp.media.editor.send.attachment = send_attachment_backup;
and it runs once. So the new questions would be: how to restore the original function after the latest item in the loop?