apply_filters( ‘wp_constrain_dimensions’, int[] $dimensions, int $current_width, int $current_height, int $max_width, int $max_height )

In this article

Filters dimensions to constrain down-sampled images to.

Parameters

$dimensionsint[]
An array of width and height values.
  • 0 int
    The width in pixels.
  • 1 int
    The height in pixels.
$current_widthint
The current width of the image.
$current_heightint
The current height of the image.
$max_widthint
The maximum width permitted.
$max_heightint
The maximum height permitted.

Source

return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height );

Changelog

VersionDescription
4.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.