From 01c842a25f0a689d472a7bcaf6c7e3aaa5065f00 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 1 Nov 2023 11:49:31 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@57042 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 078e3a2daa..31bbecc0b7 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1248,7 +1248,7 @@ function _wp_get_image_size_from_meta( $size_name, $image_meta ) { * @param int $attachment_id Image attachment ID. * @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 'medium'. - * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. + * @param array|null $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @return string|false A 'srcset' value string or false. */ @@ -1489,7 +1489,7 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac * @param int $attachment_id Image attachment ID. * @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 'medium'. - * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. + * @param array|null $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @return string|false A valid source size value for use in a 'sizes' attribute or false. */ @@ -1520,8 +1520,8 @@ function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image * * @param string|int[] $size Image size. Accepts any registered image size name, or an array of * width and height values in pixels (in that order). - * @param string $image_src Optional. The URL to the image file. Default null. - * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. + * @param string|null $image_src Optional. The URL to the image file. Default null. + * @param array|null $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * Default null. * @param int $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` * is needed when using the image size name as argument for `$size`. Default 0.