wp_image_matches_ratio
wp_image_matches_ratio ( $source_width, $source_height, $target_width, $target_height )
Parameters:- (int) source_width Width of the first image in pixels.
- (int) source_height Height of the first image in pixels.
- (int) target_width Width of the second image in pixels.
- (int) target_height Height of the second image in pixels.
Returns:- (bool) True if aspect ratios match within 1px. False if not.
Defined at: - Introduced in WordPress: 4.6.0
- Deprecated in WordPress: —
Description
Helper function to test if aspect ratios for two images match.