Tag Info

New answers tagged


I think what you need is (function(){ var featuredImage = wp.media.featuredImage.frame(); featuredImage.on('select', function(){ var attachment = featuredImage.state().get('selection').first().toJSON(); console.log(attachment); }); })(); The attachment object should have height and width properties.


The correct way to do this is to: $('#upload-background-image-one').click(function() { formfield = $('#background-size-one').attr('name'); tb_show('', 'media-upload.php?type=image&TB_iframe=true'); // Take the selected image and insert only the src path into the text field. window.send_to_editor = function(html) { ...

Top 50 recent answers are included