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: http://core.svn.wordpress.org/trunk@24352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-05-24 23:56:00 +00:00
parent 786690fd4b
commit 5f05c95014
1 changed files with 4 additions and 1 deletions

View File

@ -2048,7 +2048,7 @@ function get_embedded_video( &$content, $remove = false ) {
* @param string $type Required. 'audio' or 'video' * @param string $type Required. 'audio' or 'video'
* @param WP_Post $post Optional. Used instead of global $post when passed. * @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. * @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 ) { function get_the_post_format_media( $type, &$post = null, $limit = 0 ) {
global $wp_embed; 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 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. * @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 ) { function get_the_post_format_image( $attached_size = 'full', &$post = null ) {
if ( empty( $post ) ) 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 ); $post->format_content[ $cache_key ] = sprintf( $link_fmt, $html );
return $post->format_content[ $cache_key ]; return $post->format_content[ $cache_key ];
} }
return '';
} }
/** /**