WordPress开发者和主题制作者的搜索引擎



get_space_used ›

Since3.5.0
已弃用n/a
get_space_used ( 没有参数 )
返回:
  • (int) Used space in megabytes
定义在:
文档:

Returns the space used by the current blog.



源码

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;
}