Uses
Uses | Description |
---|---|
wp-includes/media.php: wp_constrain_dimensions() | Calculates the new dimensions for a down-sampled image. |
Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.
(int) (Required) The width of an example embed.
(int) (Required) The height of an example embed.
(int) (Required) The maximum allowed width.
(int) (Required) The maximum allowed height.
(int[]) An array of maximum width and height values.
File: wp-includes/media.php
function wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) { $example_width = (int) $example_width; $example_height = (int) $example_height; $max_width = (int) $max_width; $max_height = (int) $max_height; return wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height ); }
Version | Description |
---|---|
2.9.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_expand_dimensions