On this page
apply_filters( 'wp_constrain_dimensions', int[] $dimensions, int $current_width, int $current_height, int $max_width, int $max_height )
Filters dimensions to constrain down-sampled images to.
Parameters
$dimensionsint[]-
An array of width and height values.
- int
The width in pixels.
1intThe height in pixels.
- int
$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
File: wp-includes/media.php. View all references
return apply_filters( 'wp_constrain_dimensions', array( $w, $h ), $current_width, $current_height, $max_width, $max_height );
Related
Used By
| Used By | Description |
|---|---|
| wp_constrain_dimensions() wp-includes/media.php | Calculates the new dimensions for a down-sampled image. |
Changelog
| Version | Description |
|---|---|
| 4.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_constrain_dimensions