WordPress at Your Fingertips
filter is not described

wp_calculate_image_srcset_meta filter-hook . WP 4.5.0

Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data.


add_filter( 'wp_calculate_image_srcset_meta', 'filter_function_name_6298', 10, 4 );
function filter_function_name_6298( $image_meta, $size_array, $image_src, $attachment_id ){
	// filter...

	return $image_meta;
The image meta data as returned by 'wp_get_attachment_metadata()'.

An array of requested width and height values.

  • 0(int)
    The width in pixels.

  • 1(int)
    The height in pixels.
The 'src' of the image.
The image attachment ID or 0 if not supplied.


Since 4.5.0 Introduced.

Where the hook is called

wp-includes/media.php 1259
$image_meta = apply_filters( 'wp_calculate_image_srcset_meta', $image_meta, $size_array, $image_src, $attachment_id );

Where in WP core the hook is used WordPress

Usage not found.