fix_import_form_size

Get the remaining upload space for this site.

Description

(int) fix_import_form_size( (int) $size ); 

Returns (int)

Max size in bytes

Parameters (1)

0. $size (int)
Current max size in bytes

Usage

  1. if ( !function_exists( 'fix_import_form_size' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ms.php'; 
  3.  
  4. // Current max size in bytes 
  5. $size = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = fix_import_form_size($size); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/ms.php  
  1. function fix_import_form_size( $size ) { 
  2. if ( upload_is_user_over_quota( false ) ) { 
  3. return 0; 
  4. $available = get_upload_space_available(); 
  5. return min( $size, $available );