WordPress at a glance
filter is not described

wp_image_src_get_dimensions filter-hook . WP 5.7.0

Filters the 'wp_image_src_get_dimensions' value.


add_filter( 'wp_image_src_get_dimensions', 'filter_function_name_1939', 10, 4 );
function filter_function_name_1939( $dimensions, $image_src, $image_meta, $attachment_id ){
	// filter...

	return $dimensions;
Array with first element being the width and second element being the height, or false if dimensions could not be determined.
The image source file.
The image meta data as returned by 'wp_get_attachment_metadata()'.
The image attachment ID.


Since 5.7.0 Introduced.

Where the hook is called

wp-includes/media.php 1644
return apply_filters( 'wp_image_src_get_dimensions', $dimensions, $image_src, $image_meta, $attachment_id );

Where in WP core the hook is used WordPress

Usage not found.