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

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

Calculates the new dimensions for a downsampled image.


Description

See also


Parameters

$width

(Required) Current width of the image

$height

(Required) Current height of the image

$wmax

(Optional) Maximum wanted width

Default value: 128

$hmax

(Optional) Maximum wanted height

Default value: 96


Return

(array) Shrunk dimensions (width, height).


Source

File: wp-admin/includes/deprecated.php

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


Changelog

Changelog
Version Description
WP-3.0.0 Use wp_constrain_dimensions()
WP-2.0.0 Introduced. This function has been deprecated. Use wp_constrain_dimensions() instead.