upload_is_user_over_quota()
upload_is_user_over_quota( bool $echo = true ) 检查站点是否已使…
upload_is_user_over_quota( bool $echo = true )
检查站点是否已使用其分配的上载空间。
Check whether a site has used its allotted upload space.
目录锚点:#参数#源码
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$echo | (bool) | 如果设置了$echo并且超过了配额,则会回显一条警告消息。默认值为true。 |
源码(Source)
/** * Check whether a blog has used its allotted upload space. * * @since MU * * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true. * @return bool True if user is over upload space quota, otherwise false. */ function upload_is_user_over_quota( $echo = true ) { if ( get_site_option( 'upload_space_check_disabled' ) ) return false; $space_allowed = get_space_allowed(); if ( empty( $space_allowed ) || !is_numeric( $space_allowed ) ) $space_allowed = 10; // Default space allowed is 10 MB $space_used = get_space_used(); if ( ( $space_allowed - $space_used ) < 0="" )="" {="" if="" (="" $echo="" )="" _e(="" 'sorry,="" you="" have="" used="" your="" space="" allocation.="" please="" delete="" some="" files="" to="" upload="" more="" files.'="" );="" return="" true;="" }="" else="" {="" return="" false;="" }="" }="">
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
MU (3.0.0) | wp-admin/includes/ms.php | 20 | 9 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!