wp_create_thumbnail

This was once used to create a thumbnail from an Image given a maximum side size.

Description

(string) wp_create_thumbnail( (mixed) $file, (int) $max_side, (string) $deprecated = '' ); 

Returns (string)

Thumbnail path on success, Error string on failure.

Parameters (3)

0. $file (mixed)
Filename of the original image, Or attachment id.
1. $max_side (int)
Maximum length of a single side for the thumbnail.
2. $deprecated — Optional. (string) => ''
The deprecated.

Usage

  1. if ( !function_exists( 'wp_create_thumbnail' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/deprecated.php'; 
  3.  
  4. // Filename of the original image, Or attachment id. 
  5. $file = null; 
  6.  
  7. // Maximum length of a single side for the thumbnail. 
  8. $max_side = -1; 
  9.  
  10. // The deprecated. 
  11. $deprecated = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wp_create_thumbnail($file, $max_side, $deprecated); 
  15.  

Defined (1)

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

/wp-admin/includes/deprecated.php  
  1. function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 
  2. _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' ); 
  3. return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );