From e4e71d98ba032ff0daf598201f79a0b239d0e80e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 24 May 2013 23:56:00 +0000 Subject: [PATCH] Add @return for get_the_post_format_image(). Make sure the function always returns a string. props tollmanz. fixes #24414. see #24348. git-svn-id: https://develop.svn.wordpress.org/trunk@24352 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/media.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index d4a0df3bfc..269f3bb147 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2048,7 +2048,7 @@ function get_embedded_video( &$content, $remove = false ) { * @param string $type Required. 'audio' or 'video' * @param WP_Post $post Optional. Used instead of global $post when passed. * @param int $limit Optional. The number of medias to remove if content is scanned. - * @return string + * @return string HTML for the media. Blank string if no media is found. */ function get_the_post_format_media( $type, &$post = null, $limit = 0 ) { global $wp_embed; @@ -2420,6 +2420,7 @@ function get_post_gallery_images( $post_id = 0 ) { * * @param string $attached_size If an attached image is found, the size to display it. * @param WP_Post $post Optional. Used instead of global $post when passed. + * @return string HTML for the image. Blank string if no image is found. */ function get_the_post_format_image( $attached_size = 'full', &$post = null ) { if ( empty( $post ) ) @@ -2566,6 +2567,8 @@ function get_the_post_format_image( $attached_size = 'full', &$post = null ) { $post->format_content[ $cache_key ] = sprintf( $link_fmt, $html ); return $post->format_content[ $cache_key ]; } + + return ''; } /**