WordPress.org

Make WordPress Core

Changeset 50236


Ignore:
Timestamp:
02/08/2021 02:12:21 PM (8 months ago)
Author:
SergeyBiryukov
Message:

Docs: Clarify the @return value for wp_get_attachment_image_url() and get_the_post_thumbnail_url().

Props GeekPress, audrasjb, naveen17797.
Fixes #52183.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r50170 r50236  
    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.
    1127  * @return string|false Attachment URL or false if no image is available.
     1127 * @return string|false Attachment URL or false if no image is available. If `$size` does not match
     1128 *                      any registered image size, the original image URL will be returned.
    11281129 */
    11291130function wp_get_attachment_image_url( $attachment_id, $size = 'thumbnail', $icon = false ) {
  • trunk/src/wp-includes/post-thumbnail-template.php

    r49693 r50236  
    216216 *
    217217 * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.
    218  * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat
    219  *                           array of height and width dimensions. Default 'post-thumbnail'.
    220  * @return string|false Post thumbnail URL or false if no URL is available.
     218 * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat array
     219 *                           of height and width dimensions. Default 'post-thumbnail'.
     220 * @return string|false Post thumbnail URL or false if no image is available. If `$size` does not match
     221 *                      any registered image size, the original image URL will be returned.
    221222 */
    222223function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) {
Note: See TracChangeset for help on using the changeset viewer.