I am trying to set the default functionality for the Wordpress Media Downloader. All I want to do is access the signature metadata for each image and overlay it on a thumbnail.
I looked at the output and don’t see where the image metadata is stored, so I assume it is enabled by AJAXed.
I read several articles about creating custom modals with the help wp.media()that I have, but I just need to connect to the default modal moment, and then scroll through each image, access the metadata, and then add this to the sketch.
Just a pointer to how to access the metadata when you first open the modality will be very useful
EDIT +++
If I use the following code, when I select an image, I can access all the data I need
_media.on('select', function() {
var attachment = _media.state().get('selection').first().toJSON();
console.log(attachment);
});
I need the same output, but from the inside _media.on('open'...), so I can iterate over all the images and access their metadata from the modal
EDIT 2 +++
So, when the modal file is opened, an AJAX request is sent, which returns an array of JSON metadata for the currently loaded images. The order does not match the order of the image in the modal, but it is promising. When you scroll, another request is sent and larger images are loaded, and the metadata in another JSON array
source
share