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



wp_shrink_dimensions › WordPress Function

Since2.0.0
已弃用3.0.0
wp_shrink_dimensions ( $width, $height, $wmax = 128, $hmax = 96 )
参数: (4)
  • (int) $width Current width of the image
    Required: Yes
  • (int) $height Current height of the image
    Required: Yes
  • (int) $wmax Maximum wanted width
    Required: No
    默认: 128
  • (int) $hmax Maximum wanted height
    Required: No
    默认: 96
查看:
返回:
  • (array) Shrunk dimensions (width, height).
定义在:
文档:

Calculates the new dimensions for a downsampled image.



源码

function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );
	return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
}