Based on a supplied width/height example, returns the biggest possible dimensions based on the max width/height.
Description
See also
Parameters
$example_width
intrequired- The width of an example embed.
$example_height
intrequired- The height of an example embed.
$max_width
intrequired- The maximum allowed width.
$max_height
intrequired- The maximum allowed height.
Source
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 );
}
Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.