max_srcset_image_width WordPress Filter Hook
The max_srcset_image_width hook is used to set the maximum width for srcset images. This can be useful for ensuring that images always display at a certain size, regardless of the device on which they are viewed.
apply_filters( 'max_srcset_image_width', int $max_width , int[] $size_array ) #
Filters the maximum image width to be included in a ‘srcset’ attribute.
Parameters
- $max_width
(int)The maximum image width to be included in the 'srcset'. Default '2048'.
- $size_array
(int[])An array of requested width and height values.
- (int) The width in pixels.
- '1'
(int) The height in pixels.
Source
File: wp-includes/media.php
Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |