wp_shrink_dimensions( int $width, int $height, int $wmax = 128, int $hmax = 96 ): array

This function has been deprecated. Use wp_constrain_dimensions() instead.

Calculates the new dimensions for a downsampled image.

Description

See also

Parameters

$widthintrequired
Current width of the image
$heightintrequired
Current height of the image
$wmaxintoptional
Maximum wanted width

Default:128

$hmaxintoptional
Maximum wanted height

Default:96

Return

array Shrunk dimensions (width, height).

Source

function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );
	return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
}

Changelog

VersionDescription
3.0.0Use wp_constrain_dimensions()
2.0.0Introduced.

User Contributed Notes

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