image_make_intermediate_size

Filters the name of the saved image file.

Description

apply_filters( 'image_make_intermediate_size', (string) $filename ); 

Parameters (1)

0. $filename (string)
Name of the file.

Usage

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

Defined (2)

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

/wp-includes/class-wp-image-editor-gd.php  
  1. 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 
/wp-includes/class-wp-image-editor-imagick.php  
  1. 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),