WP_Image_Editor::resize

Advertisement

Summery Summery

Resizes current image.

Syntax Syntax

WP_Image_Editor::resize( int|null $max_w, int|null $max_h, bool $crop = false )

Description Description

At minimum, either a height or width must be provided. If one of the two is set to null, the resize will maintain aspect ratio according to the provided dimension.

Parameters Parameters

$max_w

(Required) Image width.

$max_h

(Required) Image height.

$crop

(Optional)

Default value: false

Return Return

(bool|WP_Error)

Source Source

File: wp-includes/class-wp-image-editor.php

	abstract public function resize( $max_w, $max_h, $crop = false );

Advertisement

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.

Advertisement

Leave a Reply