max_srcset_image_width хук-фильтр . WP 4.4.0
Filters the maximum image width to be included in a 'srcset' attribute.
Использование
add_filter( 'max_srcset_image_width', 'filter_function_name_5979', 10, 2 ); function filter_function_name_5979( $max_width, $size_array ){ // filter... return $max_width; }
- $max_width(число)
- The maximum image width to be included in the 'srcset'.
По умолчанию: '2048' - $size_array(массив)
- Array of width and height values in pixels (in that order).
Список изменений
С версии 4.4.0 | Введена. |
Где вызывается хук
wp-includes/media.php 1236
$max_srcset_image_width = apply_filters( 'max_srcset_image_width', 2048, $size_array );