wp_create_thumbnail

函数


wp_create_thumbnail ( $file, $max_side, $deprecated = '' )
参数
  • (mixed)
    $file
    Filename of the original image, Or attachment ID.
    Required:
  • (int)
    $max_side
    Maximum length of a single side for the thumbnail.
    Required:
  • (mixed)
    $deprecated
    Never used.
    Required:
    Default: (empty)
返回值
  • (string) Thumbnail path on success, Error string on failure.
相关
  • image_resize()
定义位置
  • wp-admin/includes/deprecated.php
    , line 1130
引入
1.2.0
弃用
3.5.0

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

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 ) );
}