Advertisement
bowenac

WP Multiple Select Media Manager in Plugin

Oct 24th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.56 KB | None | 0 0
  1.         //When a file is selected, grab the URL and set it as the text field's value
  2.         custom_uploader_photo.on('select', function() {
  3.             var selection = custom_uploader_photo.state().get('selection');
  4.             var count = 0;
  5.             selection.each( function( attachment ) {
  6.               attachment = attachment.toJSON();
  7.                 console.log(attachment);
  8.                 $("#gallery").append("<img src=" +attachment.url+" name='pic["+count+"]' style='width:150px;height:150px;'>");
  9.                 count++;
  10.             });
  11.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement