WP_Image_Editor_GD::update_sizeprotectedWP 3.5.0

Sets or updates current image size.

Method of the class: WP_Image_Editor_GD{}

No Hooks.

Returns

true.

Usage

// protected - for code of main (parent) or child class
$result = $this->update_size( $width, $height );
$width(int|null)
Image width.
Default: null
$height(int|null)
Image height.
Default: null

Changelog

Since 3.5.0 Introduced.

WP_Image_Editor_GD::update_size() code WP 7.1

protected function update_size( $width = null, $height = null ) {
	if ( ! $width ) {
		$width = imagesx( $this->image );
	}

	if ( ! $height ) {
		$height = imagesy( $this->image );
	}

	return parent::update_size( $width, $height );
}