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.


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More