Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24632 closed defect (bug) (duplicate)

get_post_thumbnail_id() returns wrong (old/original) thumbnail id after cropping a picture

Reported by: tigerde2's profile TigerDE2 Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.3
Component: Media Keywords:
Focuses: Cc:


Hi! I have associated a featured photo with my post, then realised it had the wrong dimensions. I thus cropped it using WP's image editing capabilities (applying the change to all versions of the picture) and saved it. I also reassigned the cropped image as the featured photo. However, calling

wp_get_attachment_image_src( get_post_thumbnail_id(), 'sidekick-panoramic' )

still returns Array ( [0] => http://.../wp-content/uploads/2013/06/WP_002681-666x500.jpg [1] => 666 [2] => 500 [3] => 1 ); which is the original image's thumbnail, not the cropped image's one.

I therefore believe that get_post_thumbnail_id() is returning the wrong thumbnail id and does not update it to reflect cropped pictures.

There is a forum discussion on this here:

I would expect that a call to

wp_get_attachment_image_src( get_post_thumbnail_id(), 'sidekick-panoramic' )

would return the resized image's (new) thumbnail, not the original image's thumbnail.

Please note that while the error did appear in a theme it probably is an issue with the core, as the method returning the wrong information is a core method.

Change History (1)

#1 @SergeyBiryukov
11 years ago

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

Duplicate of #19889.

Note: See TracTickets for help on using tickets.