Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 5 months ago

#54383 closed defect (bug) (duplicate)

wp_get_attachment_thumb_file looks for $imagedata['thumb'] but wp_create_image_subsizes doesn't create this array entry

Reported by: markhowellsmead's profile markhowellsmead Owned by:
Milestone: Priority: normal
Severity: major Version: 5.8.1
Component: Media Keywords:
Focuses: Cc:

Description

This has come up at https://github.com/WordPress/gutenberg/issues/33789. Calling get_the_post_thumbnail without the size parameter, or with the size parameter set explicitly to post-thumbnail (but not thumbnail), returns the full-size image. This is because wp_get_attachment_thumb_file looks for the array key thumb in the attachment metadata, but wp_create_image_subsizes doesn't generate it.

Change History (2)

#1 @joyously
3 years ago

Amazing that this has been there since version 2.1. I wonder if there is another ticket for this?
The standard sizes are listed in get_intermediate_image_sizes().

$image_sizes = array('thumbnail', 'medium', 'medium_large', 'large'); // Standard sizes

yet wp_get_attachment_thumb_file() checks for ['thumb'].

#2 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome back to WordPress Trac!

Thanks for the ticket, we're already tracking this issue in #17262. Also related: #33959.

Note: See TracTickets for help on using tickets.