Calculates the new dimensions for a downsampled image.
$widthintrequired
$heightintrequired
$wmaxintoptional
Default:128
$hmaxintoptional
Default:96
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 );
}
| Version | Description |
|---|---|
| 3.0.0 | Use wp_constrain_dimensions() |
| 2.0.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_shrink_dimensions