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

Resizes current image.

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.

Top ↑

Parameters Parameters


(int|null) (Required) Image width.


(int|null) (Required) Image height.


(bool) (Optional)

Default value: false

Top ↑

Return Return


Top ↑

Source Source

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

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

Top ↑

Changelog Changelog

Version Description
3.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.