wp_expand_dimensions( int $example_width, int $example_height, int $max_width, int $max_height )
Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.
Description Description
See also See also
Parameters Parameters
- $example_width
-
(int) (Required) The width of an example embed.
- $example_height
-
(int) (Required) The height of an example embed.
- $max_width
-
(int) (Required) The maximum allowed width.
- $max_height
-
(int) (Required) The maximum allowed height.
Return Return
(array) The maximum possible width and height based on the example ratio.
Source Source
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 ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |