Make WordPress Core

Changeset 57042


Ignore:
Timestamp:
11/01/2023 11:49:31 AM (11 months ago)
Author:
SergeyBiryukov
Message:

Docs: Correct the type for optional parameters in a few media functions.

This affects the $image_src and/or $image_meta parameters in:

  • wp_get_attachment_image_srcset()
  • wp_get_attachment_image_sizes()
  • wp_calculate_image_sizes()

Follow-up to [35412], [35419], [35481], [35498], [35569], [35672].

Props dilipbheda.
Fixes #59745.

File:
1 edited

Legend:

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

    r56838 r57042  
    12491249 * @param string|int[] $size          Optional. Image size. Accepts any registered image size name, or an array of
    12501250 *                                    width and height values in pixels (in that order). Default 'medium'.
    1251  * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
     1251 * @param array|null   $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
    12521252 *                                    Default null.
    12531253 * @return string|false A 'srcset' value string or false.
     
    14901490 * @param string|int[] $size          Optional. Image size. Accepts any registered image size name, or an array of
    14911491 *                                    width and height values in pixels (in that order). Default 'medium'.
    1492  * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
     1492 * @param array|null   $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
    14931493 *                                    Default null.
    14941494 * @return string|false A valid source size value for use in a 'sizes' attribute or false.
     
    15211521 * @param string|int[] $size          Image size. Accepts any registered image size name, or an array of
    15221522 *                                    width and height values in pixels (in that order).
    1523  * @param string       $image_src     Optional. The URL to the image file. Default null.
    1524  * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
     1523 * @param string|null  $image_src     Optional. The URL to the image file. Default null.
     1524 * @param array|null   $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
    15251525 *                                    Default null.
    15261526 * @param int          $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id`
Note: See TracChangeset for help on using the changeset viewer.