WordPress.org

Make WordPress Core

Ticket #52183: 52183.2.diff

File 52183.2.diff, 1.9 KB (added by GeekPress, 9 months ago)

More specific @return description for wp_get_attachment_image_url & get_the_post_thumbnail_url

  • src/wp-includes/media.php

    diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
    index 11b6fae7d1..04077abe8b 100644
    a b function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f 
    11251125 *                                    width and height values in pixels (in that order). Default 'thumbnail'.
    11261126 * @param bool         $icon          Optional. Whether the image should be treated as an icon. Default false.
    11271127 * @return string|false Attachment URL or false if no image is available.
     1128                        If `$size` doesn't match a registered image size, the original image URL
     1129                        will be returned.
    11281130 */
    11291131function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {
    11301132        $image = wp_get_attachment_image_src( $attachment_id, $size, $icon );
  • src/wp-includes/post-thumbnail-template.php

    diff --git a/src/wp-includes/post-thumbnail-template.php b/src/wp-includes/post-thumbnail-template.php
    index 1605afa27b..c22987da14 100644
    a b function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = 
    217217 * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.
    218218 * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat
    219219 *                           array of height and width dimensions. Default 'post-thumbnail'.
    220  * @return string|false Post thumbnail URL or false if no URL is available.
    221  */
     220 * @return string|false Post thumbnail URL or false if no image is available.
     221                        If `$size` doesn't match a registered image size, the original image URL
     222                        will be returned.
     223*/
    222224function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) {
    223225        $post_thumbnail_id = get_post_thumbnail_id( $post );
    224226