get_space_used()
最后更新于:2021-11-27 00:41:07
get_space_used()响应s the space used by the current site.
响应
(int) Used space in megabytes.
源文件
文件: gc-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 = gc_upload_dir();
$space_used = get_dirsize( $upload_dir['basedir'] ) / MB_IN_BYTES;
}
return $space_used;
}