Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 2 years 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 Owned by:
Priority: normal Milestone:
Component: Media Version: 5.8.1
Severity: major Keywords:
Cc: Focuses:

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
5 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
5 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → 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.