get_space_used() - WordPress 函数参考中文文档

返回介绍

get_space_used()

发布于 2017-09-11 字数1682 浏览 949 评论 0

get_space_used()

Returns the space used by the current blog.


描述


返回值

(int) Used space in megabytes


源代码

File: wp-includes/ms-functions.php

function get_space_used() {
	/**
	 * Filters the amount of storage space used by the current site.
	 *
	 * @since 3.5.0
	 *
	 * @param int|bool $space_used The amount of used space, in megabytes. Default false.
	 */
	$space_used = apply_filters( 'pre_get_space_used', false );
	if ( false === $space_used ) {
		$upload_dir = wp_upload_dir();
		$space_used = get_dirsize( $upload_dir['basedir'] ) / MB_IN_BYTES;
	}

	return $space_used;
}

更新日志

Version 描述
3.5.0 Introduced.

相关函数

Uses

  • wp-includes/functions.php:
    wp_upload_dir()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/ms-functions.php:
    pre_get_space_used
  • wp-includes/ms-functions.php:
    get_dirsize()

Used By

  • wp-admin/includes/ms.php:
    upload_is_user_over_quota()
  • wp-admin/includes/ms.php:
    display_space_usage()
  • wp-admin/includes/dashboard.php:
    wp_dashboard_quota()
  • wp-includes/ms-functions.php:
    get_upload_space_available()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!