get_space_used()

Returns the space used by the current site.


Description Description


Return Return

(int) Used space in megabytes.


Top ↑

Source Source

File: wp-includes/ms-functions.php

function get_space_used() {
	/**
	 * Filters the amount of storage space used by the current site, in megabytes.
	 *
	 * @since 3.5.0
	 *
	 * @param int|false $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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.