Provide easy way to return url of thumbnail image

Description

I'm sure that there is probably a hack for doing this, but for those who aren't interested in custom functions, etc., I would like a simple built-in function for referencing the thumbnail image url (or a size version of it) without bringing in the predefined image tag. I tried applying a workaround, but it collided with a plug-in I was trying to use, and hacking a pre-2.9 plug-in to use the post plugin has not gone so well because of the image tag that the get_post_thumbnail function returns.

I think the issue is that while there is a get_the_post_thumbnail() function, which corresponds to wp_get_attachment_image(), there is no get_the_post_thumbnail_src(). There is however a wp_get_attachment_image_src() function.

There probably should be a get_the_post_thumbnail_src() -- then again, there is no direct echo for wp_get_attachment_image(), while there is the_post_thumbnail().

As an alternative, you can use wp_get_attachment_image_src() with the right parameters -- check out how get_the_post_thumbnail() calls wp_get_attachment_image() for that.

get_the_post_thumbnail_src() is a convenience helper where you just want the image URL. I'd agree it's inconsistent with wp_get_attachment_image_src() - however making it consistent would lose its simplicity.