wp_create_thumbnail

The WordPress Core wp create thumbnail hook.

Description

apply_filters( 'wp_create_thumbnail', (unknown) $image_resize ); 

Parameters (1)

0. $image_resize (unknown) => image_resize( $file, $max_side, $max_side )
The image resize.

Usage

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

Defined (1)

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

/wp-admin/includes/deprecated.php  
  1. return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );