image_memory_limit

Filters the memory limit allocated for image manipulation.

Description

apply_filters( 'image_memory_limit', (int|string) $filtered_limit ); 

Parameters (1)

0. $filtered_limit (int|string)
Maximum memory limit to allocate for images. Default WP_MAX_MEMORY_LIMIT or the original php.ini memory_limit,, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as 256M..

Usage

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

Defined (1)

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

/wp-includes/functions.php  
  1. $filtered_limit = apply_filters( 'image_memory_limit', $filtered_limit );