upload_size_limit

The MailPoet Newsletters upload size limit hook.

Description

apply_filters( 'upload_size_limit', (unknown) $min, (unknown) $u_bytes, (unknown) $p_bytes ); 

Parameters (3)

0. $min (unknown) => min($u_bytes, $p_bytes)
The min.
1. $u_bytes (unknown)
The bytes.
2. $p_bytes (unknown)
The bytes.

Usage

To run the hook, copy the example below.
  1. $min = apply_filters( 'upload_size_limit', $min, $u_bytes, $p_bytes ); 
  2.  
  3. if ( !empty( $min ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the upload_size_limit callback 
  2. function filter_upload_size_limit( $min, $u_bytes, $p_bytes ) { 
  3. // make filter magic happen here... 
  4. return $min
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'upload_size_limit', 'filter_upload_size_limit', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'upload_size_limit', 'filter_upload_size_limit', 10, 3 ); 

Defined (1)

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

/helpers/numbers.php  
  1. $data['maxmegas'] = $this->return_megas(apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes ));