diff --git src/wp-includes/media.php src/wp-includes/media.php
index 043657d..77fb1dc 100644
|
|
|
function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac |
| 1074 | 1074 | * |
| 1075 | 1075 | * @since 4.4.0 |
| 1076 | 1076 | * |
| 1077 | | * @param array $sources An array of sources to include in the 'srcset'. Each source |
| 1078 | | * consists of an array containing the URL and the descriptor |
| 1079 | | * type and value (default: the image width): |
| | 1077 | * @param array $sources An array of sources to include in the 'srcset'. Each source |
| | 1078 | * consists of an array containing the URL and the descriptor |
| | 1079 | * type and value (default: the image width): |
| 1080 | 1080 | * |
| 1081 | | * image width => array( |
| 1082 | | * 'url' => string, |
| 1083 | | * 'descriptor' => string ('w' or 'x'), |
| 1084 | | * 'value' => integer (width or pixel density) |
| 1085 | | * }, |
| | 1081 | * image width => array( |
| | 1082 | * 'url' => string, |
| | 1083 | * 'descriptor' => string ('w' or 'x'), |
| | 1084 | * 'value' => integer (width or pixel density) |
| | 1085 | * }, |
| 1086 | 1086 | * |
| 1087 | | * @param int $attachment_id Image attachment ID. |
| 1088 | | * @param array $size_array Array of width and height values in pixels (in that order). |
| 1089 | | * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. |
| | 1087 | * @param array $size_array Array of width and height values in pixels (in that order). |
| | 1088 | * @param string $image_src The 'src' of the image. |
| | 1089 | * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. |
| | 1090 | * @param int $attachment_id Image attachment ID. |
| 1090 | 1091 | |
| 1091 | 1092 | */ |
| 1092 | | $sources = apply_filters( 'wp_calculate_image_srcset', $sources, $attachment_id, $size_array, $image_meta ); |
| | 1093 | $sources = apply_filters( 'wp_calculate_image_srcset', $sources, $size_array, $image_src, $image_meta, $attachment_id ); |
| 1093 | 1094 | |
| 1094 | 1095 | // Only return a 'srcset' value if there is more than one source. |
| 1095 | 1096 | if ( count( $sources ) < 2 ) { |