WP_Image_Editor_GD::resize

SummerySummery

Resizes current image.

Syntax

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

DescriptionDescription

Wraps _resize, since _resize returns a GD Resource.

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.

ParametersParameters

$max_w

(int|null) (Required) Image width.

$max_h

(int|null) (Required) Image height.

$crop

(bool) (Optional)

Default value: false

ReturnReturn

(true|WP_Error)

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
3.5.0 Introduced.
Scroll to Top