mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Docs: Clarify the @return value for wp_get_attachment_image_url() and get_the_post_thumbnail_url().
Props GeekPress, audrasjb, naveen17797. Fixes #52183. git-svn-id: https://develop.svn.wordpress.org/trunk@50236 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a8179897a2
commit
c3dd52264d
@ -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 );
|
||||
|
||||
@ -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 );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user