Trigger JS when featured image upload window is opened in admin
After some digging I discovered that wp.media.featuredImage.frame() was what I was looking for: wp.media.featuredImage.frame().on(‘open’,function() { // Clever JS here }); I then discovered that the select event fires once you’ve clicked on the ‘Set featured image’ button, not when you’ve clicked on thumbnail, which was what I was after. So I bound my events to … Read more