A WordPress-centric search engine for devs and theme authors



_image_get_preview_ratio ›

Since2.9.0
Deprecatedn/a
_image_get_preview_ratio ( $w, $h )
Parameters: (2)
  • (int) $w Image width in pixels.
    Required: Yes
  • (int) $h Image height in pixels.
    Required: Yes
Returns:
  • (float|int) Image preview ratio.
Defined at:
Codex:

Image preview ratio. Internal use only.



Source

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