W3cubDocs

/WordPress

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

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

Description

See also

Parameters

$filemixedrequired
Filename of the original image, Or attachment ID.
$max_sideintrequired
Maximum length of a single side for the thumbnail.
$deprecatedmixedoptional
Never used.

Default:''

Return

string Thumbnail path on success, Error string on failure.

Source

function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
	_deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );
	return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
}

Changelog

Version Description
3.5.0 Use image_resize()
1.2.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_create_thumbnail