From 03a4df50c7a3b4267100829f207166512631ef18 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 18 Nov 2015 22:43:05 +0000 Subject: [PATCH] Docs: Clarify some parameter and return descriptions in the DocBlocks for `wp_get_attachment_image_srcset()` and `wp_calculate_image_srcset()`, `wp_get_attachment_image_sizes()`, and the `wp_calculate_image_srcset` filter. Props joemcgill. See #34733. git-svn-id: https://develop.svn.wordpress.org/trunk@35696 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index ae108e53cc..887cc7efb2 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -936,6 +936,7 @@ function _wp_get_image_size_from_meta( $size_name, $image_meta ) { * @param array|string $size Optional. Image size. Accepts any valid image size, 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()'. + * Default null. * @return string|bool A 'srcset' value string or false. */ function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $image_meta = null ) { @@ -964,7 +965,7 @@ function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $imag * @param array $size_array Array of width and height values in pixels (in that order). * @param string $image_src The 'src' of the image. * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. - * @param int $attachment_id Optional. The image attachment ID to pass to the filter. + * @param int $attachment_id Optional. The image attachment ID to pass to the filter. Default 0. * @return string|bool The 'srcset' attribute value. False on error or when only one source exists. */ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id = 0 ) { @@ -1088,7 +1089,7 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac * @param array $size_array Array of width and height values in pixels (in that order). * @param string $image_src The 'src' of the image. * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. - * @param int $attachment_id Image attachment ID. + * @param int $attachment_id Image attachment ID or 0. */ $sources = apply_filters( 'wp_calculate_image_srcset', $sources, $size_array, $image_src, $image_meta, $attachment_id ); @@ -1115,7 +1116,8 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac * @param array|string $size Optional. Image size. Accepts any valid image size, 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()'. - * @return string|bool A 'srcset' value string or false. + * Default null. + * @return string|bool A valid source size value for use in a 'sizes' attribute or false. */ function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image_meta = null ) { if ( ! $image = wp_get_attachment_image_src( $attachment_id, $size ) ) {