Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: max_srcset_image_width

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1112      /**
1113       * Filters the maximum image width to be included in a 'srcset' attribute.
1114       *
1115       * @since 4.4.0
1116       *
1117       * @param int   $max_width  The maximum image width to be included in the 'srcset'. Default '1600'.
1118       * @param array $size_array Array of width and height values in pixels (in that order).
1119       */
1120      $max_srcset_image_width = apply_filters( 'max_srcset_image_width', 1600, $size_array );
1122      // Array to hold URL candidates.
1123      $sources = array();
1125      /**
1126       * To make sure the ID matches our image src, we will check to see if any sizes in our attachment
1127       * meta match our $image_src. If no matches are found we don't return a srcset to avoid serving
1128       * an incorrect image. See #35045.
1129       */