函数原型
get_upload_space_available(): int
函数描述
Determines if there is any upload space left in the current blog’s quota.
是否弃用
未弃用
函数参数
无
函数返回值
int of upload space available in bytes
函数位置
File: wp-includes/ms-functions.php.
函数源码
function get_upload_space_available() {
$allowed = get_space_allowed();
if ( $allowed < 0 ) {
$allowed = 0;
}
$space_allowed = $allowed * MB_IN_BYTES;
if ( get_site_option( 'upload_space_check_disabled' ) ) {
return $space_allowed;
}
$space_used = get_space_used() * MB_IN_BYTES;
if ( ( $space_allowed - $space_used ) <= 0 ) {
return 0;
}
return $space_allowed - $space_used;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

