[wp-trac] [WordPress Trac] #43413: wp_prepare_attachment_for_js missing image size medium_large
WordPress Trac
noreply at wordpress.org
Sun Feb 25 18:54:31 UTC 2018
#43413: wp_prepare_attachment_for_js missing image size medium_large
--------------------------+-----------------------------
Reporter: Themezly | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9.4
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I have a function that creates a media size in case the size is called but
is missing in meta.
https://gist.github.com/danyj/2edb3d83bae4c363bf839f0dd5f1343f
usage
{{{
thz_create_missing_attachment_size(13031,'medium_large');
}}}
every missing file size is recreated and exists in by
wp_prepare_attachment_for_js size key except the media_large because it
is missing here.
https://github.com/WordPress/WordPress/blob/dfa68397063daf90a8758896693f137f9b981856
/wp-includes/media.php#L3297-L3304
Basically if meta has been updated the wp_prepare_attachment_for_js is not
checking for sizes but manually goes by that array . Not sure if the
missing size key is left out on purpose but when you compare the
wp_prepare_attachment_for_js to wp_get_attachment_metadata the data is
not same
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43413>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list