Changeset 35672
- Timestamp:
- 11/18/2015 06:52:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r35601 r35672 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 … … 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 string $image_src Optional. The URL to the image file. Default null. 1145 1146 * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. 1146 * @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. 1149 * 1147 * Default null. 1148 * @param int $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` 1149 * is needed when using the image size name as argument for `$size`. Default 0. 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 … … 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 );
Note: See TracChangeset
for help on using the changeset viewer.