WordPress at Your Fingertips
function is not described

_image_get_preview_ratio() WP 2.9.0

Image preview ratio. Internal use only.

This is an internal function for using it by WP core itself. It's not recommended to use this function in your code.

No Hooks.

Return

float|Int. Image preview ratio.

Usage

_image_get_preview_ratio( $w, $h );
$w(int) (required)
Image width in pixels.
$h(int) (required)
Image height in pixels.

Changelog

Since 2.9.0 Introduced.

Code of _image_get_preview_ratio() WP 5.8.2

function _image_get_preview_ratio( $w, $h ) {
	$max = max( $w, $h );
	return $max > 400 ? ( 400 / $max ) : 1;
}