A WordPress-centric search engine for devs and theme authors



wp_shrink_dimensions ›

Since2.0.0
Deprecated3.0.0
wp_shrink_dimensions ( $width, $height, $wmax = 128, $hmax = 96 )
Parameters: (4)
  • (int) $width Current width of the image
    Required: Yes
  • (int) $height Current height of the image
    Required: Yes
  • (int) $wmax Maximum wanted width
    Required: No
    Default: 128
  • (int) $hmax Maximum wanted height
    Required: No
    Default: 96
See:
Returns:
  • (array) Shrunk dimensions (width, height).
Defined at:
Codex:

Calculates the new dimensions for a downsampled image.



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 );
}