WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get space used

Description

Returns the space used by the current blog.

Usage

 <?php $used get_space_used()  ?> 

Parameters

Return Value

(integer) 
Used space in megabytes

Examples

Default Usage

 <?php
	$quota = get_space_allowed();
	$used = get_space_used();

	if ( $used > $quota ){
	   // do something they have used more than quota
	}
?>

Filters

  • pre_get_space_used can be used to provide an alternative way of tracking storage space used. Returning false for this filter will revert to default behavior (megabytes used in wp_upload_dir() location).

Change Log

Source File

get_space_used is located in wp-includes/ms-functions.php

Related