upload_is_user_over_quota()提示博客空间已经达到上限

目录

描述

Check whether a blog has used its allotted upload space.

upload_is_user_over_quota() 描述

用法

 <?php upload_is_user_over_quota$echo ?> 

upload_is_user_over_quota() 用法

参数

$echo

(boolean) (可选) If $echo is set and the quota is exceeded, a warning message is echoed.

默认值: true

upload_is_user_over_quota() 参数

示例

Default Usage

upload_is_user_over_quota() 示例

历史

  • 添加于 版本: 3.5.0

upload_is_user_over_quota() 历史

源文件

upload_is_user_over_quota() 函数的代码位于 wp-admin/includes/ms.php

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * 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;="" }="" }="">

upload_is_user_over_quota() 源文件