WP_Image_Editor::crop()publicWP 3.5.0

Crops Image.

Method of the class: WP_Image_Editor{}

No Hooks.

Return

true|WP_Error.

Usage

$WP_Image_Editor = new WP_Image_Editor();
$WP_Image_Editor->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs );
$src_x(int) (required)
The start x position to crop from.
$src_y(int) (required)
The start y position to crop from.
$src_w(int) (required)
The width to crop.
$src_h(int) (required)
The height to crop.
$dst_w(int)
The destination width.
Default: null
$dst_h(int)
The destination height.
Default: null
$src_abs(true|false)
If the source crop points are absolute.
Default: false

Changelog

Since 3.5.0 Introduced.

WP_Image_Editor::crop() code WP 6.6.2

abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );