Definition:
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {}
Create a thumbnail from an Image given a maximum side size.
This function can handle most image file formats which PHP supports. If PHP does not have the functionality to save in a file of the same format, the thumbnail will be created as a jpeg.
Parameters
- mixed $file: Filename of the original image, Or attachment id.
- int $max_side: Maximum length of a single side for the thumbnail.
- mixed $deprecated: Never used.
Return values
returns:Thumbnail path on success, Error string on failure.
Defined filters
- wp_create_thumbnail
apply_filters( 'wp_create_thumbnail', $thumbpath )
Source code
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { if ( !empty( $deprecated ) ) _deprecated_argument( __FUNCTION__, '1.2' ); $thumbpath = image_resize( $file, $max_side, $max_side ); return apply_filters( 'wp_create_thumbnail', $thumbpath ); }
3519
No comments yet... Be the first to leave a reply!