Skip to content

Commit e4e71d9

Browse files
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
1 parent a06fed2 commit e4e71d9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

wp-includes/media.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,7 @@ function get_embedded_video( &$content, $remove = false ) {
20482048
* @param string $type Required. 'audio' or 'video'
20492049
* @param WP_Post $post Optional. Used instead of global $post when passed.
20502050
* @param int $limit Optional. The number of medias to remove if content is scanned.
2051-
* @return string
2051+
* @return string HTML for the media. Blank string if no media is found.
20522052
*/
20532053
function get_the_post_format_media( $type, &$post = null, $limit = 0 ) {
20542054
global $wp_embed;
@@ -2420,6 +2420,7 @@ function get_post_gallery_images( $post_id = 0 ) {
24202420
*
24212421
* @param string $attached_size If an attached image is found, the size to display it.
24222422
* @param WP_Post $post Optional. Used instead of global $post when passed.
2423+
* @return string HTML for the image. Blank string if no image is found.
24232424
*/
24242425
function get_the_post_format_image( $attached_size = 'full', &$post = null ) {
24252426
if ( empty( $post ) )
@@ -2566,6 +2567,8 @@ function get_the_post_format_image( $attached_size = 'full', &$post = null ) {
25662567
$post->format_content[ $cache_key ] = sprintf( $link_fmt, $html );
25672568
return $post->format_content[ $cache_key ];
25682569
}
2570+
2571+
return '';
25692572
}
25702573

25712574
/**

0 commit comments

Comments
 (0)