upload_size_limit_filter

Filters the maximum upload file size allowed, in bytes.

Description

(int) upload_size_limit_filter( (int) $size ); 

Returns (int)

Upload size limit in bytes.

Parameters (1)

0. $size (int)
Upload size limit in bytes.

Usage

  1. if ( !function_exists( 'upload_size_limit_filter' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // Upload size limit in bytes. 
  5. $size = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = upload_size_limit_filter($size); 
  9.  

Defined (1)

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

/wp-includes/ms-functions.php  
  1. function upload_size_limit_filter( $size ) { 
  2. $fileupload_maxk = KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ); 
  3. if ( get_site_option( 'upload_space_check_disabled' ) ) 
  4. return min( $size, $fileupload_maxk ); 
  5.  
  6. return min( $size, $fileupload_maxk, get_upload_space_available() );