函数原型
is_gd_image( resource|GdImage|false $image ): bool
函数描述
Determines whether the value is an acceptable type for GD image functions.
是否弃用
未弃用
函数参数
-
$image
resource|GdImage|false
Required - A value to check the type for.
函数返回值
bool True if $image is either a GD image resource or GdImage instance, false otherwise.
函数位置
File: wp-includes/media.php.
函数源码
function is_gd_image( $image ) {
if ( is_resource( $image ) && 'gd' === get_resource_type( $image )
|| is_object( $image ) && $image instanceof GdImage
) {
return true;
}
return false;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 5.6.0 | Introduced. |

