diff --git src/wp-includes/media.php src/wp-includes/media.php
index e693ba6..f338058 100644
|
|
|
function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium'
|
| 901 | 901 | */ |
| 902 | 902 | $img_edited = preg_match( '/-e[0-9]{13}/', $img_url, $img_edit_hash ); |
| 903 | 903 | |
| | 904 | /** |
| | 905 | * Filter the maximum width included in a srcset attribute. |
| | 906 | * |
| | 907 | * @since 4.4.0 |
| | 908 | * |
| | 909 | * @param array|string $size Size of image, either array or string. |
| | 910 | */ |
| | 911 | $max_srcset_width = apply_filters( 'max_srcset_width', 1600, $size ); |
| | 912 | |
| 904 | 913 | /* |
| 905 | 914 | * Set up arrays to hold url candidates and matched image sources so |
| 906 | 915 | * we can avoid duplicates without looping through the full sources array |
| … |
… |
function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium'
|
| 918 | 927 | continue; |
| 919 | 928 | } |
| 920 | 929 | |
| | 930 | // Filter out images that are wider than $max_srcset_width. |
| | 931 | if ( $max_srcset_width && $img['width'] > $max_srcset_width ) { |
| | 932 | $contiue; |
| | 933 | } |
| | 934 | |
| 921 | 935 | $candidate_url = path_join( dirname( $img_url ), $img['file'] ); |
| 922 | 936 | |
| 923 | 937 | // Calculate the new image ratio. |