wp_get_attachment_image should use wp_get_attachment_metadata
|Reported by:||JorritSchippers||Owned by:||wonderboymusic|
wp_get_attachment_image uses get_post_meta( $attachment_id, '_wp_attachment_metadata', true ) to fetch attachment meta data, even though the function wp_get_attachment_metadata does exactly this. This means that the filter wp_get_attachment_metadata can't be used.
The function wp_get_attachment_image calls both wp_calculate_image_srcset and wp_calculate_image_sizes with the image meta data. These two functions specify that their inputs come from wp_get_attachment_metadata, but this is not the case in practise.
BTW: media.php contains more situations where get_post_meta( $attachment_id, '_wp_attachment_metadata', true ) could be replaced by wp_get_attachment_metadata($attachment_id).
Change History (12)
13 months ago
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
- Milestone changed from Awaiting Review to Future Release
- Milestone changed from Future Release to 4.7
- Owner set to wonderboymusic
- Status changed from new to assigned
- Keywords has-patch has-unit-tests removed
- Resolution fixed deleted
- Status changed from closed to reopened