Tag Info

Hot answers tagged

2

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.


1

I presume you've fixed this already but (in a blatant attempt to snaffle the bounty and) as mentioned in the comments there's a simple fix, in your myplugin_meta_box_callback() function change the line $mime_types = array( 'application/pdf' ); to $mime_types = 'application/pdf'; The library.type option to wp.media expects a string (which can ...


1

That's the pre-3.5 media interface so I think you must be on 3.4.x? Anyway the first way should work as long as you're using the browser (non-multifile) upload... try changing add_filter( 'flash_uploader', '_force_html_uploader' ); to add_action( 'pre-html-upload-ui', '_force_html_uploader' ); and the "js/upload.js" (note the subdirectory - it's ...



Only top voted, non community-wiki answers of a minimum length are eligible