How to get all images and their thumbnails from wp media library
Here’s what you can do. Get a list of all available thumbnail sizes Query all the attachments For each attachment size, get it’s URL and save it into the array Let’s change your code into this: function get_images_highcompress_data() { $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image/jpeg,image/jpg,image/png’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => -1, ‘orderby’ … Read more