[wp-trac] [WordPress Trac] #24632: get_post_thumbnail_id() returns wrong (old/original) thumbnail id after cropping a picture
WordPress Trac
noreply at wordpress.org
Sun Jun 23 17:42:27 UTC 2013
#24632: get_post_thumbnail_id() returns wrong (old/original) thumbnail id after
cropping a picture
--------------------------+-----------------------------
Reporter: TigerDE2 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.5.2
Severity: minor | Keywords:
--------------------------+-----------------------------
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:
http://wordpress.org/support/topic/featured-image-in-sidekick-theme-not-
working-image-resize-not-picked-up
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24632>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list