WP_Image_Editor::crop()publicWP 3.5.0

Crops Image.

Метод класса: WP_Image_Editor{}

Хуков нет.

Возвращает

true|WP_Error.

Использование

$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) (обязательный)
The start x position to crop from.
$src_y(int) (обязательный)
The start y position to crop from.
$src_w(int) (обязательный)
The width to crop.
$src_h(int) (обязательный)
The height to crop.
$dst_w(int)
The destination width.
По умолчанию: null
$dst_h(int)
The destination height.
По умолчанию: null
$src_abs(true|false)
If the source crop points are absolute.
По умолчанию: false

Список изменений

С версии 3.5.0 Введена.

Код WP_Image_Editor::crop() WP 6.5.2

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