WordPress.org

Ready to get started?Download WordPress

Codex

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

Difference between revisions of "Function Reference/get space used"

(added info about pre_get_space_used filter)
m (Filters: linked)
Line 27: Line 27:
   
 
== Filters ==
 
== Filters ==
* <tt>'pre_get_space_used'</tt> can be used to provide an alternative way of tracking storage space used. Returning <tt>false</tt> for this filter will revert to default behavior (megabytes used in [[Function_Reference/wp_upload_dir|wp_upload_dir()]] location).
+
* <tt>[[Plugin_API/Filter_Reference/pre_get_space_used|pre_get_space_used]]</tt> can be used to provide an alternative way of tracking storage space used. Returning <tt>false</tt> for this filter will revert to default behavior (megabytes used in [[Function_Reference/wp_upload_dir|wp_upload_dir()]] location).
   
 
== Change Log ==
 
== Change Log ==

Revision as of 17:12, 18 December 2012

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