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.
Related Posts:
- Delete an attachment in the WP media modal window
- Rendering the uploaded file in a wp.media object
- How to set additional parameter in wp.media?
- WordPress Built In Dialog Box For My Plugin
- Media Manager: refresh library after new selection
- Media Manager (since 3.5): How to show an empty Media Library when creating a media frame?
- Extending wp.media.model, query media from different blog on network and refresh view
- Media Library modal customization
- How to create different media uploader frames / filter library depending on a custom action
- wp media popup close all popup
- How to Protect Uploads, if User is not Logged In?
- Add a menu item to WordPress 3.5 Media Manager
- Pre populate WordPress wp_media modal with image selection
- Enhance Media Manager for Gallery
- For what security reasons are svgs blocked in the media uploader?
- Update media library files after upload via FTP
- How to trigger a refresh in the media modal
- Add media with WP-Rest-API v2
- How can you set maximum width for original images?
- Custom post type with a forced fixed aspect ratio image crop
- Cleanup uploads folder, Media Library db structure
- Media library to list images only user uploaded
- ThickBox replacement
- WordPress 3.5 Media Manager – add a button
- WordPress Image Editor not working – conflict?
- How do I force WordPress to show most recent version of images in the media library?
- WordPress Media Manager 3.5 – default link to
- Proper way to add a button to the top menu of the media library?
- Linking a PDF as a downloadable document
- Filter for changing MediaElement.js Settings
- Customizing the 3.5 “Add Media” popup (Backbone.js)
- display image size in media library screen
- What is the best practice for renaming WordPress media files?
- Expanding new Media Uploader in WordPress 3.5
- How to capture the selection:toggle event fired by wp.media
- Is it possible to trigger some JavaScript when Media Popup is opened?
- wp media regenerate unknown –image_size parameter
- Refresh wp.media after ajax call
- Changing the media library default tab
- Failed to import media from a local wordpress site to a live one
- WordPress Uploads Folder can’t be Written to
- Is is possible to crop an image after uploading
- Hook for image edit popup
- Best plugin to manage media library? [closed]
- Rename “Add Media” Button To “Add Images”
- Image dimensions same as image size
- How would I go about listing only unattached media in say a sidebar?
- Best image hosting service
- How to display all images “Uploaded By” an author
- Modify the array of selected images in media modal
- Shortlink directly to a media file?
- Filter what image sizes get generated
- custom tabs in media uploader
- Is it possible to generate JPEG progressive thumbnails?
- Media manager multiple selection
- Change default tab of media manager
- Is email post notify visitor on new media upload possible?
- How to extend Media Library (WP 4.4)
- Restricting access to files within a specific folder [duplicate]
- Way to display media library in frontend
- get total number of images from media using xml-rpc
- Audio Playlist : How to bind events for “track change”, “track end”?
- Images are registered in media library but still won’t show up
- Plugin to download attached media files?
- Uploading non-media files?
- How do I control video media display sizing with native wordpress player
- Modify how gallery.js builds the shortcode [gallery ...] in tinyMCE?
- Failed media import
- Upload mobi and epub file in the MEDIA of WP
- Handle lots of images within the media uploader / selector
- Add media with WP-Rest-API v2 II
- Media > Image Sizes aren’t being applied to uploads
- Change WordPress’ media upload URL?
- Rest API rename media
- Disable drag and upload in Media Library
- Custom media picker in meta box: how to select available image sizes?
- Category checkboxes in upload modal
- Image archive without date
- Upload images from custom plugin using the media modal
- FTP files directly to Media Library wp-content\uploads
- Disable edit option in Media library
- How to get an image url from media library
- Restrict file types in the uploader of a wp.media frame
- Add media column to edit post screen
- WordPress 3.0 Media Upload Directory
- Uploading Media gives error “Missing a temporary folder.”
- Can’t edit media details in new role
- add_image_size landscape or portrait
- What table is the media’s sort order stored?
- Media is shown in listview but not in gridview whenever i activate my Custom Theme
- Add custom tab on the media manager
- Disable mouse image resizing in editor
- Add input to the media uploader and pass its value to each uploaded file
- Organizing media uploads
- Generated media have incorrect aspect ratio
- WordPress 3.5 Media Manager – add a button
- How to insert an Audio Player in a Post or Page?
- Moving existing media items to new upload path structure not updating full URL path
- Proper way to change the path of uploads folder for existing WordPress site
- wp.media edit attachment screen