WPDev.one
Core Function
View Source on Trac ↗

wp_shrink_dimensions()

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

Calculates the new dimensions for a downsampled image.

Parameters 2 required

Name / Type Description
$width
int

Current width of the image

Required
$height
int

Current height of the image

Required
$wmax
int

Maximum wanted width

$hmax
int

Maximum wanted height

Return Value

(array)
Shrunk dimensions (width, height).

Function Information

Since Version
2.0.0
Source File
wp-admin/includes/deprecated.php
Advertisement