函数原型
has_image_size( string $name ): bool
函数描述
Checks if an image size exists.
是否弃用
未弃用
函数参数
-
$name
string
Required - The image size to check.
函数返回值
bool True if the image size exists, false if not.
函数位置
File: wp-includes/media.php.
函数源码
function has_image_size( $name ) {
$sizes = wp_get_additional_image_sizes();
return isset( $sizes[ $name ] );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.9.0 | Introduced. |

