函数原型
get_udims( int $width, int $height ): array
函数描述
Calculated the new dimensions for a downsampled image.
是否弃用
Warning: This function has been deprecated. Use wp_constrain_dimensions() instead.
函数参数
-
$width
int
Required - Current width of the image
-
$height
int
Required - Current height of the image
函数返回值
array Shrunk dimensions (width, height).
函数位置
File: wp-admin/includes/deprecated.php.
函数源码
function get_udims( $width, $height ) {
_deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' );
return wp_constrain_dimensions( $width, $height, 128, 96 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.5.0 | Use wp_constrain_dimensions() |
| 2.0.0 | Introduced. |

