Post Thumbnails: In get_the_post_thumbnail_url(), return false instead of empty string when no URL is available.

Fixes #33070.


git-svn-id: https://develop.svn.wordpress.org/trunk@34480 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-24 04:37:48 +00:00
parent e366584fae
commit 3a8f42bfe0

View File

@ -179,11 +179,11 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @param string|array $size Optional. Registered image size to retrieve the source for or a flat
* array of height and width dimensions. Default 'post-thumbnail'.
* @return string Post thumbnail URL or empty string.
* @return string|false Post thumbnail URL or false if no URL is available.
*/
function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) {
$image = wp_get_attachment_image_url( get_post_thumbnail_id( $post ), $size );
return isset( $image ) ? $image : '';
return isset( $image ) ? $image : false;
}
/**