wp_calculate_image_sizes хук-фильтрWP 4.4.0


add_filter( 'wp_calculate_image_sizes', 'wp_kama_wp_calculate_image_sizes_filter', 10, 5 );
function wp_kama_wp_calculate_image_sizes_filter( $sizes, $size, $image_src, $image_meta, $attachment_id ){
	// filter...

	return $sizes;
A source size value for use in a 'sizes' attribute.
Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
The URL to the image file or null.
The image meta data as returned by wp_get_attachment_metadata() or null.
Image attachment ID of the original image or 0.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

wp-includes/media.php 1520
return apply_filters( 'wp_calculate_image_sizes', $sizes, $size, $image_src, $image_meta, $attachment_id );

Где используется хук в WordPress

Использование не найдено.