wp_crop_image
wp_crop_image ( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false )
Parameters:- (string|int) src The source file or Attachment ID.
- (int) src_x The start x position to crop from.
- (int) src_y The start y position to crop from.
- (int) src_w The width to crop.
- (int) src_h The height to crop.
- (int) dst_w The destination width.
- (int) dst_h The destination height.
- (bool|false) src_abs Optional. If the source crop points are absolute.
- (string|false) dst_file Optional. The destination file to write to.
Returns:- (string|WP_Error) New filepath on success, WP_Error on failure.
Defined at: - Introduced in WordPress: 2.1.0
- Deprecated in WordPress: —
Description
Crops an image to a given size.