On this page
WP_Image_Editor::crop( int $src_x, int $src_y, int $src_w, int $src_h, int $dst_w = null, int $dst_h = null, bool $src_abs = false ): true|WP_Error
Crops Image.
Parameters
$src_xint Required-
The start x position to crop from.
$src_yint Required-
The start y position to crop from.
$src_wint Required-
The width to crop.
$src_hint Required-
The height to crop.
$dst_wint Optional-
The destination width.
Default:
null $dst_hint Optional-
The destination height.
Default:
null $src_absbool Optional-
If the source crop points are absolute.
Default:
false
Return
true|WP_Error
Source
File: wp-includes/class-wp-image-editor.php. View all references
abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_image_editor/crop