| @@ -1022,9 +1022,16 @@ | ||
| 1022 | 1022 | $mergedArray['featured_post_url'] = get_permalink( $post_id ); |
| 1023 | 1023 | |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | - $result[] = array_merge( $image, $mergedArray, $orientation ); | |
| 1026 | + // Everything above can read the full attachment metadata, but it ends up in the page as | |
| 1027 | + // data-gallery-images, and the front-end only needs the dimensions. Every size and the EXIF | |
| 1028 | + // were bloating the HTML of big galleries (wp.org forum, 2026-09). The map layout returns | |
| 1029 | + // earlier with its own data. | |
| 1030 | + $item = array_merge( $image, $mergedArray, $orientation ); | |
| 1031 | + $meta = is_array( $image['meta'] ) ? $image['meta'] : []; | |
| 1032 | + $item['meta'] = [ 'width' => $meta['width'] ?? null, 'height' => $meta['height'] ?? null ]; | |
| 1033 | + $result[] = $item; | |
| 1027 | 1034 | } |
| 1028 | 1035 | |
| 1029 | 1036 | $this->gallery_process = $previous_gallery_process; |
| 1030 | 1037 | $this->gallery_layout = $previous_gallery_layout; |