wp_image_matches_ratio

SummerySummery

Helper function to test if aspect ratios for two images match.

Syntax

wp_image_matches_ratio( int $source_width, int $source_height, int $target_width, int $target_height )

ParametersParameters

$source_width

(int) (Required) Width of the first image in pixels.

$source_height

(int) (Required) Height of the first image in pixels.

$target_width

(int) (Required) Width of the second image in pixels.

$target_height

(int) (Required) Height of the second image in pixels.

ReturnReturn

(bool) True if aspect ratios match within 1px. False if not.

SourceSource

File: wp-includes/media.php


			

ChangelogChangelog

Changelog
Version Description
4.6.0 Introduced.
Scroll to Top