From 3a8f42bfe0a43834f736f2f5e557dd6f6a1ba400 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Sep 2015 04:37:48 +0000 Subject: [PATCH] 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 --- src/wp-includes/post-thumbnail-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/post-thumbnail-template.php b/src/wp-includes/post-thumbnail-template.php index a024b1c00b..a648a6f82c 100644 --- a/src/wp-includes/post-thumbnail-template.php +++ b/src/wp-includes/post-thumbnail-template.php @@ -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; } /**