display_space_usage
Displays the amount of disk space used by the current site.
Description
display_space_usage();
Not used in core.
Usage
if ( !function_exists( 'display_space_usage' ) ) { require_once ABSPATH . '/wp-admin/includes/ms.php'; } // NOTICE! Understand what this does before running. $result = display_space_usage();
Defined (1)
The function is defined in the following location(s).
- /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