wp_shrink_dimensions

The timeline below displays how wordpress function wp_shrink_dimensions has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.6

/**
 * Calculates the new dimensions for a downsampled image.
 *
 * @since 2.0.0
 * @deprecated 3.0.0 Use wp_constrain_dimensions()
 * @see wp_constrain_dimensions()
 *
 * @param int $width Current width of the image
 * @param int $height Current height of the image
 * @param int $wmax Maximum wanted width
 * @param int $hmax Maximum wanted height
 * @return array Shrunk dimensions (width, height).
 */
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);
}

WordPress Version: 4.4

/**
 * Calculates the new dimensions for a downsampled image.
 *
 * @since 2.0.0
 * @deprecated 3.0.0 Use wp_constrain_dimensions()
 * @see wp_constrain_dimensions()
 *
 * @param int $width Current width of the image
 * @param int $height Current height of the image
 * @param int $wmax Maximum wanted width
 * @param int $hmax Maximum wanted height
 * @return array Shrunk dimensions (width, height).
 */
function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96)
{
    _deprecated_function(__FUNCTION__, '3.0', 'wp_constrain_dimensions()');
    return wp_constrain_dimensions($width, $height, $wmax, $hmax);
}

WordPress Version: 3.7

/**
 * Calculates the new dimensions for a downsampled image.
 *
 * @since 2.0.0
 * @deprecated 3.0.0
 * @deprecated Use wp_constrain_dimensions()
 * @see wp_constrain_dimensions()
 *
 * @param int $width Current width of the image
 * @param int $height Current height of the image
 * @param int $wmax Maximum wanted width
 * @param int $hmax Maximum wanted height
 * @return array Shrunk dimensions (width, height).
 */
function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96)
{
    _deprecated_function(__FUNCTION__, '3.0', 'wp_constrain_dimensions()');
    return wp_constrain_dimensions($width, $height, $wmax, $hmax);
}