From b10a946c2c8c6c6d243fb73190659dbb907d5a86 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 18 Nov 2015 22:44:27 +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. Built from https://develop.svn.wordpress.org/trunk@35696 git-svn-id: http://core.svn.wordpress.org/trunk@35660 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 8 +++++--- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index ae108e53cc..887cc7efb2 100644 --- a/wp-includes/media.php +++ b/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 ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 9247e12275..b0bae3dc1f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta4-35695'; +$wp_version = '4.4-beta4-35696'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.