diff --git src/wp-includes/media.php src/wp-includes/media.php
index 30df322..8713f77 100644
|
|
function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium' |
905 | 905 | return false; |
906 | 906 | } |
907 | 907 | |
908 | | // Use the URL from the intermediate size or build the url from the metadata. |
| 908 | // Use the URL from the intermediate size or build the URL from the metadata. |
909 | 909 | if ( ! empty( $image['url'] ) ) { |
910 | 910 | $img_url = $image['url']; |
911 | 911 | } else { |
… |
… |
function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium' |
934 | 934 | $img_edited = preg_match( '/-e[0-9]{13}/', $img_url, $img_edit_hash ); |
935 | 935 | |
936 | 936 | /** |
937 | | * Filter the maximum width included in a srcset attribute. |
| 937 | * Filter the maximum width included in a 'srcset' attribute. |
938 | 938 | * |
939 | 939 | * @since 4.4.0 |
940 | 940 | * |
941 | | * @param array|string $size Size of image, either array or string. |
| 941 | * @param int $max_width The maximum width to include in the 'srcset'. Default '1600'. |
| 942 | * @param array|string $size Image size. Image size or an array of width and height |
| 943 | * values in pixels (in that order). |
942 | 944 | */ |
943 | 945 | $max_srcset_width = apply_filters( 'max_srcset_image_width', 1600, $size ); |
944 | 946 | |
945 | 947 | /* |
946 | | * Set up arrays to hold url candidates and matched image sources so |
| 948 | * Set up arrays to hold URL candidates and matched image sources so |
947 | 949 | * we can avoid duplicates without looping through the full sources array |
948 | 950 | */ |
949 | 951 | $candidates = $sources = array(); |
… |
… |
function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium' |
994 | 996 | * |
995 | 997 | * @param array $sources An array of image urls and widths. |
996 | 998 | * @param int $attachment_id Attachment ID for image. |
997 | | * @param array|string $size Image size. Accepts any valid image size, or an array of width and height |
998 | | * values in pixels (in that order). Default 'medium'. |
| 999 | * @param array|string $size Image size. Image size or an array of width and height |
| 1000 | * values in pixels (in that order). |
999 | 1001 | */ |
1000 | 1002 | return apply_filters( 'wp_get_attachment_image_srcset_array', $sources, $attachment_id, $size ); |
1001 | 1003 | } |
… |
… |
function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium' ) { |
1030 | 1032 | * |
1031 | 1033 | * @param string $srcset A source set formated for a `srcset` attribute. |
1032 | 1034 | * @param int $attachment_id Attachment ID for image. |
1033 | | * @param array|string $size Image size. Accepts any valid image size, or an array of width and height |
1034 | | * values in pixels (in that order). Default 'medium'. |
| 1035 | * @param array|string $size Image size. Image size or an array of width and height |
| 1036 | * values in pixels (in that order). |
1035 | 1037 | */ |
1036 | 1038 | return apply_filters( 'wp_get_attachment_image_srcset', rtrim( $srcset, ', ' ), $attachment_id, $size ); |
1037 | 1039 | } |
… |
… |
function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $width |
1075 | 1077 | * |
1076 | 1078 | * @param string $sizes A source size value for use in a 'sizes' attribute. |
1077 | 1079 | * @param int $attachment_id Post ID of the original image. |
1078 | | * @param array|string $size Image size. Accepts any valid image size, or an array of width and height |
1079 | | * values in pixels (in that order). Default 'medium'. |
| 1080 | * @param array|string $size Image size. Image size or an array of width and height |
| 1081 | * values in pixels (in that order). |
1080 | 1082 | * @param int $width Display width of the image. |
1081 | 1083 | */ |
1082 | 1084 | return apply_filters( 'wp_get_attachment_image_sizes', $sizes, $attachment_id, $size, $width ); |