Skip to content

Commit

Permalink
fix: Woocommerce image archive ratio, preserving cropping with Optimo…
Browse files Browse the repository at this point in the history
…le images, fixes #85
  • Loading branch information
selul committed Mar 26, 2019
1 parent 17879b4 commit a3a8504
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inc/app_replacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ protected static function image_sizes() {
} else {
self::$image_sizes = $images;
}
self::$image_sizes = array_map(
function ( $value ) {
$value['crop'] = isset( $value['crop'] ) ?
( is_array( $value['crop'] )
? $value['crop'] :
(bool) $value['crop'] )
: false;

return $value;
},
self::$image_sizes
);

return is_array( self::$image_sizes ) ? self::$image_sizes : array();
}
Expand Down

0 comments on commit a3a8504

Please sign in to comment.