diff --git src/wp-includes/media.php src/wp-includes/media.php
index f8a2da5..d54ddbb 100644
|
|
|
function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image |
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | /** |
| 1139 | | * Create 'sizes' attribute value for an image. |
| | 1139 | * Creates a 'sizes' attribute value for an image. |
| 1140 | 1140 | * |
| 1141 | 1141 | * @since 4.4.0 |
| 1142 | 1142 | * |
| 1143 | 1143 | * @param array|string $size Image size to retrieve. Accepts any valid image size, or an array |
| 1144 | 1144 | * of width and height values in pixels (in that order). Default 'medium'. |
| 1145 | | * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. |
| | 1145 | * @param string $image_src Optional. The URL to the image file. Default null. |
| | 1146 | * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. Default null. |
| 1146 | 1147 | * @param int $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` is needed |
| 1147 | | * when using the image size name as argument for `$size`. |
| 1148 | | * @param string $image_src Optional. The URL to the image file. |
| | 1148 | * when using the image size name as argument for `$size`. Default 0. |
| 1149 | 1149 | * |
| 1150 | 1150 | * @return string|bool A valid source size value for use in a 'sizes' attribute or false. |
| 1151 | 1151 | */ |
| 1152 | | function wp_calculate_image_sizes( $size, $image_src, $image_meta, $attachment_id = 0 ) { |
| | 1152 | function wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $attachment_id = 0 ) { |
| 1153 | 1153 | $width = 0; |
| 1154 | 1154 | |
| 1155 | 1155 | if ( is_array( $size ) ) { |
| … |
… |
function wp_calculate_image_sizes( $size, $image_src, $image_meta, $attachment_i |
| 1181 | 1181 | * |
| 1182 | 1182 | * @param string $sizes A source size value for use in a 'sizes' attribute. |
| 1183 | 1183 | * @param array|string $size Requested size. Image size or array of width and height values |
| 1184 | | * in pixels (in that order). Default 'medium'. |
| 1185 | | * @param string $image_src The URL to the image file. |
| 1186 | | * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. |
| 1187 | | * @param int $attachment_id Image attachment ID of the original image. |
| | 1184 | * in pixels (in that order). |
| | 1185 | * @param string|null $image_src The URL to the image file or null. |
| | 1186 | * @param array|null $image_meta The image meta data as returned by 'wp_get_attachment_metadata()' or null. |
| | 1187 | * @param int $attachment_id Image attachment ID of the original image or 0. |
| 1188 | 1188 | */ |
| 1189 | 1189 | return apply_filters( 'wp_calculate_image_sizes', $sizes, $size, $image_src, $image_meta, $attachment_id ); |
| 1190 | 1190 | } |