astra_get_dynamic_image_aspect_ratio( string $aspect_ratio_type, string $predefined_scale, string $custom_scale_width, string $custom_scale_height )
Return the aspect-ratio for dynamic image.
Description
Parameters
- $aspect_ratio_type
-
(string) (Required) Aspect ratio type.
- $predefined_scale
-
(string) (Required) Predefined scale.
- $custom_scale_width
-
(string) (Required) Custom scale width.
- $custom_scale_height
-
(string) (Required) Custom scale height.
Return
(string)
Source
File: inc/extras.php
function astra_get_dynamic_image_aspect_ratio( $aspect_ratio_type, $predefined_scale, $custom_scale_width, $custom_scale_height ) {
$aspect_ratio_css = '';
if ( 'default' !== $aspect_ratio_type ) {
if ( 'custom' === $aspect_ratio_type ) {
$aspect_ratio_css = absint( $custom_scale_width ) . '/' . absint( $custom_scale_height );
} else {
$aspect_ratio_css = $predefined_scale;
}
}
return $aspect_ratio_css;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |