Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#43413 new defect (bug)

wp_prepare_attachment_for_js missing image size medium_large

Reported by: themezly's profile Themezly Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.4
Component: Media Keywords: needs-patch
Focuses: Cc:


I have a function that creates a media size in case the size is called but is missing in meta.



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.

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

Change History (1)

#1 @joemcgill
5 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Hi @Themezly. Thanks for the report!

When this size was originally added in WordPress 4.4 [35479], we intentionally avoided making that size available in public APIs or UI while we waited to see how the new size would affect performance. At this point, I think it's safe to say this is an established size in WP and should be available in APIs.

Note: See TracTickets for help on using tickets.