WordPress开发者和主题制作者的搜索引擎



_image_get_preview_ratio ›

Since2.9.0
已弃用n/a
_image_get_preview_ratio ( $w, $h )
参数: (2)
  • (int) $w Image width in pixels.
    Required: Yes
  • (int) $h Image height in pixels.
    Required: Yes
返回:
  • (float|int) Image preview ratio.
定义在:
文档:

Image preview ratio. Internal use only.



源码

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