From 8bc5c10684668981cba936c62237a9141a4ad377 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 8 Feb 2021 14:14:08 +0000 Subject: [PATCH] Docs: Clarify the `@return` value for `wp_get_attachment_image_url()` and `get_the_post_thumbnail_url()`. Props GeekPress, audrasjb, naveen17797. Fixes #52183. Built from https://develop.svn.wordpress.org/trunk@50236 git-svn-id: http://core.svn.wordpress.org/trunk@49897 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 3 ++- wp-includes/post-thumbnail-template.php | 7 ++++--- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 11b6fae7d1..f02f5f8d6b 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1124,7 +1124,8 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). Default 'thumbnail'. * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. - * @return string|false Attachment URL or false if no image is available. + * @return string|false Attachment URL or false if no image is available. If `$size` does not match + * any registered image size, the original image URL will be returned. */ function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) { $image = wp_get_attachment_image_src( $attachment_id, $size, $icon ); diff --git a/wp-includes/post-thumbnail-template.php b/wp-includes/post-thumbnail-template.php index 1605afa27b..162d7872b2 100644 --- a/wp-includes/post-thumbnail-template.php +++ b/wp-includes/post-thumbnail-template.php @@ -215,9 +215,10 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = * @since 4.4.0 * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. - * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat - * array of height and width dimensions. Default 'post-thumbnail'. - * @return string|false Post thumbnail URL or false if no URL is available. + * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat array + * of height and width dimensions. Default 'post-thumbnail'. + * @return string|false Post thumbnail URL or false if no image is available. If `$size` does not match + * any registered image size, the original image URL will be returned. */ function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) { $post_thumbnail_id = get_post_thumbnail_id( $post ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 0b1eacf2f0..2770bfb597 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-beta1-50235'; +$wp_version = '5.7-beta1-50236'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.