get_udims() - WordPress 函数参考中文文档

返回介绍

get_udims()

发布于 2017-09-11 字数1441 浏览 872 评论 0

Warning: This function has been deprecated. Use wp_constrain_dimensions() instead.

get_udims( int $width,  int $height )

Calculated the new dimensions for a downsampled image.


描述


参数

$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 描述
3.5.0 Use wp_constrain_dimensions()
2.0.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/media.php:
    wp_constrain_dimensions()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!