原型

_crop_image_resource( GD_Resource $img, float $x, float $y, float $w, float $h )

参数

$img (GD_Resource) (Required)

$x (float) (Required)

$y (float) (Required)

$w (float) (Required)

$h (float) (Required)

返回值

(GD_Resource)  

源文件

路径:wp-admin/includes/image-edit.php

<?php
...
	if ( function_exists('imagerotate') ) {
		$rotated = imagerotate($img, $angle, 0);
		if ( is_resource($rotated) ) {
			imagedestroy($img);
			$img = $rotated;
		}
	}
	return $img;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/_crop_image_resource/