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

返回介绍

display_space_usage()

发布于 2017-09-10 字数1507 浏览 972 评论 0

display_space_usage()

Displays the amount of disk space used by the current site. Not used in core.


描述


源代码

File: wp-admin/includes/ms.php

function display_space_usage() {
	$space_allowed = get_space_allowed();
	$space_used = get_space_used();

	$percent_used = ( $space_used / $space_allowed ) * 100;

	if ( $space_allowed > 1000 ) {
		$space = number_format( $space_allowed / KB_IN_BYTES );
		/* translators: Gigabytes */
		$space .= __( 'GB' );
	} else {
		$space = number_format( $space_allowed );
		/* translators: Megabytes */
		$space .= __( 'MB' );
	}
	?>
	<strong><?php
		/* translators: Storage space that's been used. 1: Percentage of used space, 2: Total space allowed in megabytes or gigabytes */
		printf( __( 'Used: %1$s%% of %2$s' ), number_format( $percent_used ), $space );
	?></strong>
	<?php
}

更新日志

Version 描述
MU Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()
  • wp-includes/ms-functions.php:
    get_space_allowed()
  • wp-includes/ms-functions.php:
    get_space_used()

User Contributed Notes

上一篇:display_setup_form()

下一篇:display_theme()

发布评论

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

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