2

Wordpress defines the maximum resolution included in the new srcset attribute in the media.php with the following line:

$max_srcset_image_width = apply_filters( 'max_srcset_image_width', 1600, $size_array );

Is there any way to change that value (via hook etc) from my themes functions.php? Right now I changed it in the media.php itself (which is not recommended – I know...).

Fabian Sebastian
  • 329
  • 5
  • 17

1 Answers1

3

I had success adding this to my functions.php file

function new_srcset_max($max_width) {
    return 2000;
}

add_filter('max_srcset_image_width', 'new_srcset_max');
DC-GPM
  • 46
  • 1