WordPress开发者和主题制作者的搜索引擎



wp_create_thumbnail ›

Since1.2.0
已弃用3.5.0
wp_create_thumbnail ( $file, $max_side, $deprecated = '' )
参数: (3)
  • (mixed) $file Filename of the original image, Or attachment id.
    Required: Yes
  • (int) $max_side Maximum length of a single side for the thumbnail.
    Required: Yes
  • (mixed) $deprecated Never used.
    Required: No
    默认: (empty)
查看:
返回:
  • (string) Thumbnail path on success, Error string on failure.
定义在:
文档:

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